LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   How to configure Nagios to use remote mail server (https://www.linuxquestions.org/questions/linux-server-73/how-to-configure-nagios-to-use-remote-mail-server-811265/)

amit.naudiyal 05-31-2010 08: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 10: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.

http://cri.ch/linux/docs/sk0009.html

Gives a good overview.

amit.naudiyal 06-01-2010 01: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" mail@domain.com".

sendmail.mc:
------------
define(`SMART_HOST', `my.smtp.server')dnl
define(`confAUTH_MECHANISMS', `EXTERNAL GSSAPI DIGEST-MD5 CRAM-MD5 LOGIN PLAIN')dnl
FEATURE(`authinfo',`hash /etc/mail/auth/client-info')dnl

aut/client-info:
----------------

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

Please advise. Thanks in advance !!

kirukan 06-01-2010 01: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 03:05 AM

Now, mails are able to be sent from command "date |/usr/sbin/sendmail -s "Test Mail" mail@domain.com". 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 sendmail.mc as mails are sending from root@localhost & sending to root@localhost...


No messages in maillog regarding it.

ComputerErik 06-01-2010 07: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-01-2010 11:15 PM

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 08:34 PM.