Email Server for nagios


I just have installed nagios and i want to integrate it with mail system to have mail alerts to administrators inbox.
our mail server is MS exchange 2003.

could you advice me what are configuration and steps to finish this task?

best regards


Nagios uses a server internal MTA, it depends on the MTA configuration what you can do… usually postfix (and i’d expect all others too, like exim or sendmail) with almost default configs is able to send emails to fully qualified email adresses.
If you want the mail to remain internal to your domain you will need to configure the MTA using a hostrelay option of some kind and you’ll have to check that your mail server accepts inbound emails from the nagios server.
This is a bit outside the scope of nagios configurations as it’s not nagios doing anything different it’s the mail agent configured differently. :slight_smile:


thank you ,
from your email i understand that i have to install an MTA server and MTA server will relay mails to mail server!
so, nagios dont have any configuration option which send mails directly to outside SMTP server?

thanks again


That’s correct. It uses the mail (or mailx) command. Whatever you defines in the commands.cfg file in the notify* commands.


In case you are using ubuntu 9.10, this is my notes to set up the email relay to exchange:

[code]sudo apt-get install mailx
Select sattellite and enter relay server (in this case the exchange server)

test in terminal
(NB: company server only accept relay for local addresses)
Enter to end subject
CTRL-D to end body

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.[/code]