Nagios Core 3.4 Issue in notification

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
praveen.ks
Posts: 41
Joined: Wed May 29, 2013 5:35 pm

Nagios Core 3.4 Issue in notification

Post by praveen.ks »

I configured nagios core 3.4 in ubuntu 12.04, it's working fine and I installed postfix for mail notification

when am typing in terminal
root@ns:~# mail [email protected]
________________am getting mail____________


but, in nagios am not getting notification. In command.cfg file i given like this

'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$
}

# 'notify-service-by-email' command definition
define command{
command_name notify-service-by-email
command_line /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$\n" | /usr/bin/mail -s "** $NOTIFICATIONTYPE$ Service Alert: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
}


In contacts.cfg file i given like this

define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email [email protected] ; CHANGE THIS TO YOUR EMAIL ADDRESS ******
}


Can anyone please check and tell me, how to resolve the issue
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: Nagios Core 3.4 Issue in notification

Post by gshergill »

Hi praveen.ks,

We have a post on our website which goes through the installation of a mail server on Nagios for Ubuntu (or at least the best way I could find to). It is quite old but should still apply:

http://www.globility.co.uk/?p=386

In essence, you need to install heirloom-mailx after postfix, then edit the commands.cfg by changing the paths from /usr/bin/mail to /usr/bin/mailx.

Good luck!

Kind Regards,

Gary Shergill
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Nagios Core 3.4 Issue in notification

Post by lmiltchev »

praveen.ks,

Let us know if the solution, posted by gshergill solved your problem.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked