LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 05-31-2010, 08:41 AM   #1
amit.naudiyal
LQ Newbie
 
Registered: May 2010
Posts: 18

Rep: Reputation: 0
Post 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.
 
Old 05-31-2010, 10:38 AM   #2
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 268

Rep: Reputation: 42
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.
 
Old 06-01-2010, 01:02 AM   #3
amit.naudiyal
LQ Newbie
 
Registered: May 2010
Posts: 18

Original Poster
Rep: Reputation: 0
Smile

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" "Password"

Please advise. Thanks in advance !!
 
Old 06-01-2010, 01:33 AM   #4
kirukan
Senior Member
 
Registered: Jun 2008
Location: Eelam
Distribution: Redhat, Solaris, Suse
Posts: 1,219

Rep: Reputation: 131Reputation: 131
what is the output when you send mail from command line? is there any errors and check /var/log/maillog?
 
Old 06-01-2010, 03:05 AM   #5
amit.naudiyal
LQ Newbie
 
Registered: May 2010
Posts: 18

Original Poster
Rep: Reputation: 0
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.
 
Old 06-01-2010, 07:10 AM   #6
ComputerErik
Member
 
Registered: Apr 2005
Location: NYC
Distribution: Debian, RHEL
Posts: 268

Rep: Reputation: 42
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.
 
Old 06-01-2010, 11:15 PM   #7
amit.naudiyal
LQ Newbie
 
Registered: May 2010
Posts: 18

Original Poster
Rep: Reputation: 0
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...
 
  


Reply

Tags
mail, nagios, remote, server


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Nagios - check RAM usage on remote server mikeshn Linux - Software 9 08-04-2011 02:44 AM
how to configure hylafax and nagios server pawan_lal Linux - Server 5 12-10-2009 10:39 AM
command line email client to send mail to remote mail server dhanju Linux - Software 1 03-07-2008 06:37 AM
Configure & Connect a Linux mail server from a windows mail clients digihall7 Linux - Networking 4 10-23-2006 12:21 PM
how to configure Linux mail client with existing mail server running on WindowsXP? Senthilvnr Linux - Networking 1 07-11-2006 12:02 AM


All times are GMT -5. The time now is 03:45 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration