Send notification only if notificationtype=PROBLEM
Posted: Thu Jun 04, 2015 3:55 am
Hello,
I would like to send a notification only in case of a problem. I don't want to send notification when it is recovery or flapping.
I tried this but it does not work :
Any idea ?
Thanks
I would like to send a notification only in case of a problem. I don't want to send notification when it is recovery or flapping.
I tried this but it does not work :
Code: Select all
define command {
command_name notify-service-problem-by-email
command_line [ "$NOTIFICATIONTYPE$" = "PROBLEM" ] && /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Thanks