Hi
I have two servers on two different networks. I would like to implement
some sort of a watchdog application between the two to inform me should
either of the machines go down or has a connection problem.
I was thinking along the line of using a PHP script running from cron on
an hourly basis to "ping" the server as well as another server such as
google.com (they seem to be always up) and to only raise the alarm when
google can be reached, but NOT the other server.

My only problem is with the actual recognition of a "failed" ping, or
for that matter a successful one?

Can anyone give me some brain food as to the code for detecting a
up/down connection?

pseudo code:

make connection with server1
get result of connection_server1
make connection with google.com
get result of connection_google

if connection_google && !connection_server1
        sms me
else
        chill out


and a plus would be to do this ONLY if the result of the next cron-run
is the same, ie, don't sms me if the problem has been fixed within an
hour.
I just don';t know what to use to "make connection" and "get result of
connection"

Thanks.






-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to