Blackhold

modificar suject alertas de nagios

Posted on gener 27th, 2011 by admin

Queremos añadir la etiqueta [MISUPERNAGIOS] en el asunto de los mails de alerta que nos lleguen.
También podemos modificar la estructura del mensaje.

#vi /etc/nagios/objects/commands.cfg
# ‘notify-host-by-email’ command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nHost: $HOSTNAME$nState: $HOSTSTATE$nAddress: $HOSTADDRESS$nInfo: $HOSTOUTPUT$nnDate/Time: $LONGDATETIME$n” | /usr/bin/mail -r email@contacto.com -s “[MISUPERNAGIOS]** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **” $CONTACTEMAIL$
}

# ‘notify-service-by-email’ command definition
define command{
command_name notify-service-by-email
command_line /usr/bin/printf “%b” “***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nnService: $SERVICEDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nnDate/Time: $LONGDATETIME$nnAdditional Info:nn$SERVICEOUTPUT$n” | /usr/bin/mail -r email@contacto.com -s “[MISUPERNAGIOS]** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **” $CONTACTEMAIL$
}

Leave a Response

« »

guy fawkes