adrianlzt/puppet-monitoring — pull request #109 by adrianlzt (2014-03-21 12:30:20+00:00)
Title: Variable para enviar el entorno en los emails

Definimos una variable con el nombre del entorno para poder usar el mismo comando de notificacion para todos los entornos.

Los comandos:

notify-service-by-email
/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTNAME$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$\n" | /bin/mail -s "[Icinga-dSN][$USER5$] $NOTIFICATIONTYPE$ Service Alert: $HOSTNAME$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

notify-host-by-email
/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\ nDate/Time: $LONGDATETIME$\n" | /bin/mail -s "[Icinga-dSN][$USER5$] $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$