Tool
tool
Reads:
894
Score:
license:
GPLhome page url:
http://www.susethailand.comThis script discovers if the network is down and the output is logged & emailed to <root>.
- Copy script to /usr/local/sbin/ping_network
- chmod 744 /usr/local/sbin/ping_network
- crontab -e
* * * * 1-5 /usr/local/sbin/ping_network - edit HOSTS
#!/bin/sh # By Mr. Sontaya Photibut # website http://www.susethailand.com # GPL License # 27/06/2008 HOSTS=" 192.168.0.1 192.168.11.1 192.168.12.1 192.168.13.1 192.168.15.1 192.168.16.1 192.168.17.1 192.168.18.1 192.168.19.1 192.168.20.1 192.168.22.1 " for HOST in $HOSTS do ping -c1 -w1 $HOST > /dev/null if [ $? -ne 0 ] then logger "ping: $HOST DOWN" echo -n "$HOST DOWN on " && date +%d/%m/%Y-%H:%M:%S else logger "ping: $HOST UP" fi done exit 0<






0