-   Linux - Server (
-   -   Nagios email notifications don't get sent, need to configure mailx, how? (

mitchell7man 01-21-2010 09:01 PM

Nagios email notifications don't get sent, need to configure mailx, how?
1 Attachment(s)
Okay so I've set up nagios on a CentOS 5 box and am having trouble getting it to send out email, nagios is monitoring several systems/services in the building. What I need to do is to get nagios to send notifications using a mail server rather than trying to send from itself, if that makes sense. I've googled all over the place about how to do this, but I couldn't find clear steps or guidelines everywhere and I haven't gotten the emails to get out of the box. So I guess my question is what are the steps I need to follow to get nagios email notifications sending through an external mail server?

Thanks for any help you might be able to provide.

-Mitchell Jones

an image of my .mailrc is attached....

EricTRA 01-22-2010 01:12 AM


Do you have any MTA (Mail Transfer Agent) like for example Postfix set up? Also can you indicate if you are sending mail to your own mail server or to something like a GMail/Hotmail/other account? The way I have it set up is using Postfix to relay all mail to our GMail for Enterprises and it works like a charm.

Kind regards,


mitchell7man 01-26-2010 02:44 PM

I believe I have postfix installed, but don't know exactly how to configure it to interact with nagios and the mail server. I'm trying to send the email through my companies mail server.

EricTRA 01-26-2010 02:53 PM


If you have Postfix installed then all you have to do is configure it to relay the mail to your company's mailserver. Is the Nagios server on the same network as the mailserver? Configuration of Postfix for this is done in the configuration file. I'm not familiar with CentOS but I think it should be in /etc/postfix directory.

In order to relay your mails from Nagios to your mailserver in your file you should have something like this:

myhostname =
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination =, localhost,
relayhost =
mynetworks =
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost
relay_domains =

That should get you started sending mail to your mailserver. Of course you'll have to tell your mailserver to allow relaying from your nagios server in order to work.

Kind regards,


All times are GMT -5. The time now is 05:29 PM.