[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: ping shell script



On Sun, 25 Apr 2004 12:10:06 +0200, Deboo wrote:

>    How to make a script which would ping the server every few minutes to
>    check if it's up or down and also log this status as well as time
>    of pinging and any error messages.

Doing something similar, I'd recommend a cronjob ('every few minutes');
executing something like 

$ echo `date`, `ping -c 2 www.mysite.com` >> ping.log

Of course, with some grep and cut (and 'if ... fi') you can refine it to
extract responses and log in case of error / success only.

HTH,

Uwe



Reply to: