aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes Ping Server Status & Action Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Ping Server Status & Action" Watch "Ping Server Status & Action" New topic
Author

Ping Server Status & Action

Tarun Trehan
Ranch Hand

Joined: Mar 16, 2012
Posts: 49

Hi All,

I have a blog site for which i need to check the status and send an alert if the blog is not up and running.
I need to repeat this task every 30 minutes(configurable in code). Though i have couple of other questions which i can come to later; my initial one is that:
"If the server has not been started/not responding , there is problem and i should get a notification/alert for it.
I wrote the java code for this. However, whenever the server is not started, i do not get a proper response code; instead i get a "Connect Exception".
Hence, i have to call the alert/notification code from an exception."
Is that correct (to initiate a business scenario from a catch block) or am i missing something here ??

Following are some code snippets.


Thanks,
Tarun Trehan (http://allzhere.in)
Tarun Trehan
Ranch Hand

Joined: Mar 16, 2012
Posts: 49

All,

Appreciate a response and inputs on this query.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Ping Server Status & Action