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
Notes Macro disables alarms
Re: Notes Macro disables alarms
$HOSTNOTES$ should always be defined. If it's not, I would say something else is going on. Can we see your hosts.cfg file? And for fun, change $HOSTNOTES$ to $HOSTNOTESURL$ and see if you still have the same problem (I know you're not using HOSTNOTESURL, this is just a test).
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Notes Macro disables alarms
It didn't worked out even with $HOSTNOTESURL$ when the command checks a host without the parameter, it stucks and stop. By the way, I don't have a hosts.cfg... I create all the host in the objects folder and then add them to nagios.cfg file.eloyd wrote:$HOSTNOTES$ should always be defined. If it's not, I would say something else is going on. Can we see your hosts.cfg file? And for fun, change $HOSTNOTES$ to $HOSTNOTESURL$ and see if you still have the same problem (I know you're not using HOSTNOTESURL, this is just a test).
Re: Notes Macro disables alarms
I wasn't able to recreate the issue. I added "ID Circuit: $HOSTNOTES$" to the 'notify-host-by-email' command definition, didn't add any notes, but I still received the alert.
Can you send custom host notification, then search the mail log?
Was the custom alert sent?
Code: Select all
Notification Type: CUSTOM
Host: localhost
State: UP
Address: 127.0.0.1
ID Circuit:
Info: OK - 127.0.0.1: rta 0.027ms, lost 0%
Date/Time: Thu Aug 7 13:05:09 CDT 2014Code: Select all
tail -50 /var/log/maillogBe sure to check out our Knowledgebase for helpful articles and solutions!
Re: Notes Macro disables alarms
Well I gave up. I realized that it's not possible. I'd better configure for each host a NOTE parameter and alerts and sent softly. Thanks for your time guys. Solved.