$CONTACTEMAIL$ wouldn't expand to actual value

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
lkthomas
Posts: 7
Joined: Mon Jan 06, 2014 5:11 am

Re: $CONTACTEMAIL$ wouldn't expand to actual value

Post by lkthomas »

[1389861271.115887] [2048.0] [pid=4089] WARNING: Could not find a macro matching 'CONTACTEMAIL"'!
[1389861271.115895] [2048.0] [pid=4089] WARNING: An error occurred processing macro 'CONTACTEMAIL"'!


define command {
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** System Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mailx -r nagios@one.com -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" "$CONTACTEMAIL"
}
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: $CONTACTEMAIL$ wouldn't expand to actual value

Post by sreinhardt »

Still getting it huh... Could you remove the reference to bin/mailx and instead pipe to a file so that we can see the resulting output from this check?

Code: Select all

define command {
command_name notify-host-by-log
command_line /usr/bin/printf "%b" "***** System Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" >> /tmp/check_log
}
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked