Outils pour utilisateurs

Outils du site


bash:pingcheck

Checks ping of servers on both IPv4 & IPv6.

pingcheck
#!/bin/bash
checkdate=$(date)
server1=$(echo "www.suumitsu.eu")
server2=$(echo "www.mitsuneko.eu")
echo $checkdate >> upcheck.log
ping -c1 $server1 > /dev/null && echo "[up4] $server1" >> upcheck.log || echo "[DOWN4] $server1" >> upcheck.log
ping6 -c1 $server1 > /dev/null && echo "[up6] $server1" >> upcheck.log || echo "[DOWN6] $server1" >> upcheck.log
ping -c1 $server2 > /dev/null && echo "[up4] $server2" >> upcheck.log || echo "[DOWN4] $server2" >> upcheck.log
ping6 -c1 $server2 > /dev/null && echo "[up6] $server2" >> upcheck.log || echo "[DOWN6] $server2" >> upcheck.log
echo "****" >> upcheck.log
bash/pingcheck.txt · Dernière modification: 2013/02/19 19:28 (modification externe)