Page 1 of 1

Free variable empty

Posted: Tue Jul 24, 2018 5:44 am
by sib
Hi

I defined a command which uses free variables

The commands looks like this

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\n$_HOSTCUSTOM_MESSAGE$" | /bin/mail -s "Nagios Alert: $_HOSTCUSTOM_SUBJECT$" $CONTACTEMAIL$
Then I defined a service that uses that alert notification command and defined 2 free variables
Capture.PNG
When the alert comes it has a subject "Nagios Alert: $" It does not show the content of the free variable.

Nagios XI 5.4.13

Re: Free variable empty

Posted: Tue Jul 24, 2018 2:13 pm
by lmiltchev
I haven't been able to recreate the issue in house.

If these are service free variables, instead of using the command below:

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\n$_HOSTCUSTOM_MESSAGE$" | /bin/mail -s "Nagios Alert: $_HOSTCUSTOM_SUBJECT$" $CONTACTEMAIL$
you should be using:

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\n$_SERVICECUSTOM_MESSAGE$" | /bin/mail -s "Nagios Alert: $_SERVICECUSTOM_SUBJECT$" $CONTACTEMAIL$
Can you show us the actual notification email, and the configuration file for the "problem" service?