Nagios 3.2.1 on ubuntu notification problems

Skyggna
Skyggna used Ask the Experts™
on
Hello,

I am having problems making the notifications in nagios work. I have installed nagios and it works but not with the email notifications (http://community.spiceworks.com/how_to/show/833) I have also installed postfix to relay post to the exchange server and there is an open relay from the nagios server to the exchange server. Any ideas?
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Hi,
  Try enabling notification at the configuration file itself.

ENABLE_SVC_NOTIFICATIONS       <host_name>;<service_description>       This is used to re-enable notifications for the specified service. Note that both the host name and service description are required.

Also make sure you have configured proper email address in contacts.cfg as below  :

define contact{

        contact_name                    mdsouza_e               ; Short
name of user

        use                             generic-contact         ;
Inherit default values from generic-contact template (defined above)

        alias                           Marvin D'Souza          ; Full
name of user

        email                           XXXXX     ; <<***** CHANGE THIS
TO YOUR EMAIL ADDRESS ******

        }

Author

Commented:
are you talking about the commands.cfg file? the contacts.cfg file is configured to send mail to a valid address.

I see in the commands file there is a text saying that I should use /usr/bin/mailx instead of /usr/bin/mail I have tried with both options... does this path need to point to postfix?
i maby should mention that i am rather new to linux and nagios :-)
yes it should point to your mail function , do you see, server not being able to send emails in your log ?

Author

Commented:
sorry for the delay... there is nothing in the mail logfile indicating that a mail is being sent... i installed postfix as an sattelite routing mail to my exchange server, mail from the nagios pc works fine (telnet) but I think there might be something wrong with the nagios settings... in my commands.cfg file I have tried both /usr/bin/mail as well as /usr/bin/mailx...any suggestions?

Author

Commented:
the nagios log file is posting thist error "name@email.com resulted in a return code of 127. make sure the script or binary you are trying to execute actually exsists...
Hi, I didn't use postfix, only mailx. Uninstall both and reinstall mailx.

sudo apt-get install mailx

Select the following options:
Mail system type: Satellite
Domain: domain.local
SMTP host: mailhost.domain.local

You'll have to edit the Nagios email notification commands found in /usr/local/nagios/etc/objects/commands.cfg and change any '/bin/mail' references to '/usr/bin/mail'. Once you do that you'll need to restart Nagios to make the configuration changes live.

sudo /etc/init.d/nagios restart

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial