[Sussex] Ping protocol

John Crowhurst fyremoon at fyremoon.net
Tue Jun 24 17:11:01 UTC 2003


> Do you know where I can learn about the Ping protocol, I can not find
> it.
>
> All I want to do is write my own program so it informs me when something
> has gone wrong with the connection.
>
> I have written an script to scan that IP address but that is rather
> lame, keeping an shell running all the time.  I think more use full if I
> get write an program that informed me when it goes wrong.

The simplest way is via a simple shell script:

if ping -c 1 host >/dev/null;
then echo "OK"
else echo "Not OK"
#Do something about it here
fi

All you need to do then is to place the script into your crontab and it
will check periodically.

--
John






More information about the Sussex mailing list