Notes Macro disables alarms
Posted: Mon Aug 04, 2014 1:15 pm
Hello people, im little concern about this.
I modified the command of sending alarm messages by email and it worked awesome. Here is how it looks:
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** NOC *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nID Circuit: $HOSTNOTES$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s " NOC ** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
The thing is if I configure a host without set notes parameter, immediately I stop receiving alarms to the email. So, is there any way to tell Nagios that if a host doesnt have notes parameter just ignored it?
Thanks in Advance
I modified the command of sending alarm messages by email and it worked awesome. Here is how it looks:
# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** NOC *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nID Circuit: $HOSTNOTES$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s " NOC ** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
}
The thing is if I configure a host without set notes parameter, immediately I stop receiving alarms to the email. So, is there any way to tell Nagios that if a host doesnt have notes parameter just ignored it?
Thanks in Advance