[FUG-BR] Watchdogd
Marcelo Prota
marceloprota em hotmail.com
Sexta Agosto 25 16:07:47 BRT 2006
#!/bin/sh
# Hosts para os testes de ping
HOST1="200.221.2.45" #UOL
HOST2="200.176.3.142" #TERRA
HOST3="200.152.161.127" #YAHOO
LOG="/var/log/check-ping"
# Pingando
test1=`/sbin/ping -c 1 $HOST1 | grep transmitted, | cut -d" " -f4`
test2=`/sbin/ping -c 1 $HOST2 | grep transmitted, | cut -d" " -f4`
test3=`/sbin/ping -c 1 $HOST3 | grep transmitted, | cut -d" " -f4`
# Se pingou OK, se nao reboot NOW!
if [ $test1 = 1 ] || [ $test2 = 1 ] || [ $test3 = 1 ]; then
echo -e "PING OK! Servidor ONLINE"
echo "#########################################" >> $LOG
echo "PING OK! Servidor ONLINE" >> $LOG
date >> $LOG
echo "#########################################" >> $LOG
else
echo "#########################################" >> $LOG
echo "The system is going down for reboot NOW!" >> $LOG
date >> $LOG
echo "#########################################" >> $LOG
shutdown -r now
fi
----------------------------------------
> Date: Tue, 22 Aug 2006 11:26:26 -0300
> From: gusmao em wminas.com
> To: freebsd em fug.com.br
> Subject: [FUG-BR] Watchdogd
>
> Pessoal, como faço para configurar o watchdogd no freebsd para quando o sistema
> travar, parar de responder, dar um reboot na máquina???
>
> Att
> Gusmão
>
> -------------------------
> Histórico: http://www.fug.com.br/historico/html/freebsd/
> Sair da lista: https://www.fug.com.br/mailman/listinfo/freebsd
_________________________________________________________________
Experimente o Live.com: seu mundo online em um só lugar - com notícias, esportes, previsão do tempo e muito mais.
http://www.live.com/getstarted
Mais detalhes sobre a lista de discussão freebsd