From: Vlade (vlader@optonline.net)
Date: Wed Jul 17 2002 - 16:34:06 EDT
Thanks everyone for the quick responses , this was my favorite from .Moti
Levy. I love simplicity.
#! /bin/sh
for host in `cat /etc/hosts |awk '{print $2}'` ;do
echo $host
ping 2 $host > /dev/null 2>&1
if [ "$?" != "0" ] ;then
echo "$host is dead " |mailx -s "$host ping alert" you@yourdomain.com
fi
done
Original Post:
> Anyone have or know where I can get a Perl or shell script to ping a list
of
> hosts and send me an email if they're down? I'm not looking for total
server
> monitoring programs, just a simple script that takes either a simple flat
file
> of hosts or defines them with in an array in the script that will send me
mail
> when any of them are down.
>
> Thanks a bunch.
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:24:37 EDT