martes, 31 de marzo de 2009

hst_event_handler

#!/bin/sh

#########################################
# Nagios Global Host Event Handler by Isuraeru
# For Audio Using Festival
#
# Arguments:
#
# $1 = host short name
# $2 = host alias (long name)
# $3 = state
# $4 = state type (HARD or SOFT)
# $5 = current attempt number
#
#########################################

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

case $4 in
HARD)
case $3 in
UP)
$echocmd "Host, , , $2 has RECOVERED!" | $festival --tts
;;
DOWN)
$echocmd "Attention, , , , Host $2 is $3. This is a critical state. Please check host status!" | $festival --tts
;;
UNREACHABLE)
$echocmd "Attention, , , , Host $2 is $3. This is a critical state. Please check network connectivity!" | $festival --tts
;;
esac
;;
SOFT)
# Ignore soft error states
;;
esac

exit 0

No hay comentarios:

Publicar un comentario en la entrada

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