LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Nagios email notification failure (https://www.linuxquestions.org/questions/linux-newbie-8/nagios-email-notification-failure-932625/)

NewtoUbuntu8.1 03-04-2012 01:57 AM

Nagios email notification failure
 
Hi, I've setup nagios on a Ubuntu 10.04 machine to monitor our site network, works a treat except for the fact that the email notifications do not work.
I installed nagios as per the Ubuntu quickstart guide.

when I run the 'notify-service-by-email' command definition from the commands.cfg file in a terminal session I get an error message.
this is a copy of the command

/usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

the error message that I get is below:
bash: /usr/bin/mail: No such file or directory

I hope that somebody can help me with this issue

chrism01 03-04-2012 07:25 PM

Funnily enough, the error msg means what it says ....
Code:

bash: /usr/bin/mail: No such file or directory
ie the mail prog is not in /usr/bin.
Try
Code:

which mail
On RHEL it's in /bin/mail

NewtoUbuntu8.1 03-05-2012 10:45 AM

Yes I know that it was missing what I was after was to find out how to fix it!!

I have now found the fix, it requires the mail utilities installing as below:

sudo apt-get install mailutils


All times are GMT -5. The time now is 03:48 PM.