martes, 31 de marzo de 2009

hst_event_handler-speechd

#!/bin/sh

#########################################
# Nagios Global Service Event Handler by Isuraeru
# For audio using Speechd
# 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"
festivaldev="/dev/speech"

case $4 in
HARD)
case $3 in
UP)
$echocmd "Good news! Host $2 has RECOVERED!" > $festivaldev
;;
DOWN)
$echocmd "Attention... Host $2 is $3. This is a critical state. Please check host status!" > $festivaldev
;;
UNREACHABLE)
$echocmd "Attention... Host $2 is $3. This is a critical state. Please check network connectivity!" > $festivaldev
;;
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.