How to setup nagios to send notifications

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
henjohn1515
Posts: 1
Joined: Thu Mar 29, 2012 4:04 pm

How to setup nagios to send notifications

Post 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?
hotfootrob
Posts: 1
Joined: Tue Apr 03, 2012 2:06 pm

Re: How to setup nagios to send notifications

Post 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.
alceryes
Posts: 41
Joined: Wed Sep 28, 2011 11:05 am

Re: How to setup nagios to send notifications

Post 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.
Locked