Hello,
I work with Jimmy (author of the topic), and I work on this problem too.
For French speaker, I made more debug here :
http://forums.monitoring-fr.org/index.php?topic=6612
I will try to explain everything here :
The problem occurs after a second reload of Nagios.
Here is the notification command :
Code: Select all
define command{
command_name notification_service_par_mail
command_line $USER1$/sendmailservices.sh "$CONTACTEMAIL$" "$ADMINEMAIL$"
}
Here is my notification script (for test) :
Code: Select all
#!/bin/bash
TO=$1
EMETTEUR=$2
echo "$TO $EMETTEUR" >> /tmp/notifBash.log
1- I restart Nagios and force a notification, everything works fine :
2- I reload Nagios and force a notification, everything works fine :
3- I reload Nagios again and force a notification, problem occurs :
--- Another test, if my script sendmailservices.sh is not executable :
1- I restart Nagios and force a notification, here is the nagios warning :
[1366287128] Warning: Attempting to execute the command "/usr/local/nagios/libexec/sendmailservices.sh "
[email protected]" "
[email protected]"" resulted in a return code of 126. Make sure the script or binary you are trying to execute actually exists...
2- I reload Nagios and force a notification, here is the nagios warning :
[1366287189] Warning: Attempting to execute the command "/usr/local/nagios/libexec/sendmailservices.sh "
[email protected]" "
[email protected]"" resulted in a return code of 126. Make sure the script or binary you are trying to execute actually exists...
3- I reload Nagios again and force a notification, here is the nagios warning :
[1366287254] Warning: Attempting to execute the command "/usr/local/nagios/libexec/sendmailservices.sh "
[email protected]" "user%40domain.fr"" resulted in a return code of 126. Make sure the script or binary you are trying to execute actually exists...
My conclusion : after a second reload, nagios converts the '@' in the 'ADMINEMAIL' macro...