martes, 31 de marzo de 2009

svc_event_handler

#!/bin/sh

#########################################
# Nagios Global Service Event Handler by Isuraeru
# For audio using Festival
# Arguments:
#
# $1 = host short name
# $2 = host alias (long name)
# $3 = service description
# $4 = state
# $5 = state type (HARD or SOFT)
# $6 = current attempt number
#
#########################################

echocmd="/bin/echo"
festival="/path/to/festival/bin/festival"

case $5 in
HARD)
case $4 in
OK)
$echocmd "Good News,,, Service $3 on $2 has RECOVERED" | $festival --tts
;;
CRITICAL)
$echocmd "Attention,,,, Service $3 on $2 is in a $4 state. Please check service!" | $festival --tts
;;
WARNING)
$echocmd "Attention,,,, Service $3 on $2 is in a $4 state. Please check service!" | $festival --tts
;;
UNKNOWN)
$echocmd "Attention,,,, Service $3 on $2 is in a $4 state. Please check service!" | $festival --tts
;;
esac
;;
SOFT)
# Ignore soft error states
;;
esac

exit 0

No hay comentarios:

Publicar un comentario

Nota: solo los miembros de este blog pueden publicar comentarios.