email notification problem
test 123king
test123king at yahoo.com
Fri Jan 27 03:44:33 CET 2006
I have set up nagios nagios-1.3-14.fc4 in my FC4 server, the only problem now is the email notification can't be send out.
The original notify-by-email in misccommands.cfg file is like below:
# 'notify-by-email' command definition
define command{
command_name notify-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nnService: $SERVIC
EDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nnDate/Time: $DATETIME$nnAdditional Info:n
n$OUTPUT$" | -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
I changed it to :
# 'notify-by-email' command definition
define command{
command_name notify-by-email
command_line /bin/mail "%b" "***** Nagios *****nnNotification Type: $NOTIFICATIONTYPE$nnService: $SERVIC
EDESC$nHost: $HOSTALIAS$nAddress: $HOSTADDRESS$nState: $SERVICESTATE$nnDate/Time: $DATETIME$nnAdditional Info:n
n$OUTPUT$" | -s "** $NOTIFICATIONTYPE$ alert - $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}
Basically I replaced /usr/bin/printf with /bin/mail.
In the /var/log/messages log I see the following error:
Warning: Attempting to execute the command "/bin/mail "%b" "***** Nagios *****nnNotification Type: RECOVERYnHost: Server-1nState: UPnAddress: 10.100.1.79nInfo: PING OK - Packet loss = 0%, RTA = 0.76 msnnDate/Time: Thu Jan 26 17:48:21 EST 2006n" | -s "Host UP alert for Server-OTM!" sysadmin at www.com" resulted in a return code of 127. Make sure the script or binary you are trying to execute actually exists...
Any kind help is highly appreciated!!
---------------------------------
What are the most popular cars? Find out at Yahoo! Autos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20060126/65adcf96/attachment.html>
More information about the Users
mailing list