-   Linux - Server (
-   -   How to configure Nagios to use remote mail server (

amit.naudiyal 05-31-2010 09:41 AM

How to configure Nagios to use remote mail server
I have installed Nagios 3 on CentOS 5.2. Everything is running. It is monitoring 10 machines and 60 services for now. Now I want email notifications for the critical alerts from Nagios. I am already having one mail server (Qmail) running on different machine and I want to use its reference to send alerts to my network. Please guide.

ComputerErik 05-31-2010 11:38 AM

Debian has a neat little package called nullmailer just for this sort of thing, but CentOS has no such package. You will need to configure sendmail to use a smart relay and specify the extrernal server.

Gives a good overview.

amit.naudiyal 06-01-2010 02:02 AM

Hello ComputerErik,

Thanks for your response. I have configured my sendmail on Nagios machine as per instructions but I am not able to send any mail even from command line "/usr/sbin/sendmail -s "Test Mail"".
define(`SMART_HOST', `my.smtp.server')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl


AuthInfo:my.smtp.server "U:username" "I:user" "P:password"

Please advise. Thanks in advance !!

kirukan 06-01-2010 02:33 AM

what is the output when you send mail from command line? is there any errors and check /var/log/maillog?

amit.naudiyal 06-01-2010 04:05 AM

Now, mails are able to be sent from command "date |/usr/sbin/sendmail -s "Test Mail"". But it is not getting delivered to the destination. I think it is still using the local system's parameters not the defined parameters in as mails are sending from root@localhost & sending to root@localhost...

No messages in maillog regarding it.

ComputerErik 06-01-2010 08:10 AM

There will be a log somewhere (maillog, mail, syslog, messages) showing that a message was sent and either a successful handoff to a remote server or an error. I don't have a RedHat box available right now to see what the exact logs are. You can also try checking the logs of your remote server to ensure that it isn't rejecting the attempts to connect and use as a relay.

Why are you using the sendmail directly to send out mail? Nagios will by default use either the mail or mailx command, so try using those and testing as well.

amit.naudiyal 06-02-2010 12:15 AM

Hi Erik,

I was just trying to check from command line, whether it really send the mail using sendmail command but to no avail.... ! I did not find any logs anywhere. May be some configuration issues....
Now, I am using email package with Nagios and am using that to shoot the mails. Its working properly with Nagios. Hope I will continue using this for my purpose. Thank you for you responses till now...

Thank you all...

All times are GMT -5. The time now is 10:57 PM.