[SATLUG] program or cron job to ping internal devices & email
geoff at w5omr.shacknet.nu
Wed Jan 16 05:15:57 CST 2008
> Does know or have a program or cron job that can ping network devices and if
> down send out an email?
Well, ping returns a result, right? if it doesn't you could do a number
One that comes to mind, is to ping whatever you want, for a specified
amount of pings, pipe that info to a file then have the cron exit with
an error level, check the file size and it's other than 0b, don't send a
Of course, you'd probably want to ping whoever for about 15 or 20
responses so that there's significant data in the text file you've piped
your ping information to.
just as an example...
I got a return of
:> ls -la ping.txt
-rw-r--r-- 1 geoff users 1007 2008-01-16 05:12 ping.txt
when I did
:> ping -c10 w5omr.shacknet.nu >ping.txt
so, you could write a simple little script file to call ping, pipe the
output to a file, check if the filesize is greater than 0bytes and if
not, send a message.
Clear as mud?
More information about the SATLUG