Script para ver si apache esta funcionando correctamente
Estimados: Les envío un script interesante hecho en BASH, para monitorear si nuestro servidor apache esta funcionando correctamente, luego lo pueden poner en un cron, y obviamente lo pueden modificar, por ejemplo ahora lo que haces es que si no esta funcionando apache por algún motivo, lo reinicia, pero yo lo tengo en mi server que aparte me envíe un email al cell. ---- #!/bin/bash URL="localhost/index.html" TIMEOUT=10 # segundos MATCH="<html>" restart="service httpd restart" # "service" solo funciona con MDK, REDHAT o SUSE wget -q -O - --timeout=$TIMEOUT --tries=1 "$URL" | grep -q "$MATCH" || { # Algo esta mal asi que hay que anunciar o reiniciar en este caso eval "$restart" exit $? } exit 0 ---- Saludos, -- Martín G. Gaido Linux+ & RHCE Certified Pro Cell: +54 (02477) 15590965 Office: +54 (02477) 435350 eMail: [email protected] MSN IM: [email protected] SMS: [email protected] Skype: martin_gaido Websites: http://www.linuxargentina.org http://www.emultisoft.com http://www.martingaido.com http://www.fsf.org http://www.debian.org http://www.mialug.org
participants (1)
-
Martin Gaido [eMultiSoft.com]