Page 1 of 1

How to setup nagios to send notifications

Posted: Thu Mar 29, 2012 4:14 pm
by henjohn1515
I installed nagios 3.2.3 on Ubuntu 10.04. I need assistnace with configuring naigos to send notifications. Can I use Postfix or sendmail?

Re: How to setup nagios to send notifications

Posted: Tue Apr 03, 2012 2:14 pm
by hotfootrob
I have installed Postfix on my Ubuntu 10.04 server with Nagios 3.2.3 and am unable to get Nagios to send emails out. Here is an excerpt from my commands.cfg file, the part in bold was changed early in my testing.


# 'notify-host-by-email' command definition
define command{
command_name notify-host-by-email
command_line /usr/bin/printf "%b" "***** Nagios *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$

I am using NagiosQL(3.1.1) as the backend to create my hosts/services files etc. I am able to telnet to this machine and send a test email out that way, so I know that it is able to send messages. Any ideas or solutions would be greatly appreciated.

Re: How to setup nagios to send notifications

Posted: Wed Apr 04, 2012 10:35 am
by alceryes
I had the same issue. I ended up uninstalling postfix and using sendmail. But it still didn't work until I installed the 'mailutils' package.

# apt-get install mailutils

...hope this helps.