Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Online Status Indicator

Status
Not open for further replies.

Fadius

IS-IT--Management
Jul 25, 2001
139
US
I have a server which is running on ip: 66.41.149.84 and on port: 1716.

What I want to do is have a status on my web page that if the server is running on this port, it will indicate this. I was thinking of something like a graphic. I would have an offline graphic if noting was running on this port, then if something was, a different image would appear (online). I know this would involve some sort of if then type programming, but I do now if this can be done in java or another language.

Any help would be greatly appreciated.
 
Hi mate,

I'm not sure how you want to implement this, whether show it when the page first loads or when the user clicks a button etc so the below is based on how to do it when the page is loading.

Set-up a small script in your preferred language to ping the port on the machine and check the response. Use a conditional statment that displays the appropriate image based on the response.

Depending on how you implement this, you might hit a problem where the server return is slow, making the page slow to appear as it needs to wait for the response. You could set the TTL high enough to allow a response but low enough to prevent a long delay. If the TTL is exceeded without a response, then assume the server is down.

You could also cache the results to prevent the check on every page load if the page has a high turnover of visitors.

Hope this helps Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top