#!/bin/sh
#########################################
# Nagios Global Service Event Handler by Isuraeru
# For audio using speechd
# 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"
festivaldev="/dev/speech"
case $5 in
HARD)
case $4 in
OK)
$echocmd "Good news! Service $3 on $2 has RECOVERED!" > $festivaldev
;;
CRITICAL)
$echocmd "Attention... Service $3 on $2 is in a $4 state. Please check service!" > $festivaldev
;;
WARNING)
$echocmd "Attention... Service $3 on $2 is in a $4 state. Please check service!" > $festivaldev
;;
UNKNOWN)
$echocmd "Attention... Service $3 on $2 is in a $4 state. Please check service!" > $festivaldev
;;
esac
;;
SOFT)
# Ignore soft error states
;;
esac
exit 0
Suscribirse a:
Enviar comentarios (Atom)
No hay comentarios:
Publicar un comentario
Nota: solo los miembros de este blog pueden publicar comentarios.