LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 01-21-2010, 08:01 PM   #1
mitchell7man
Member
 
Registered: Jan 2007
Location: Draper, UT
Distribution: Ubuntu, Windows 10, OSX
Posts: 461

Rep: Reputation: 31
Nagios email notifications don't get sent, need to configure mailx, how?


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....
Attached Thumbnails
Click image for larger version

Name:	Screen shot 2010-01-21 at 6.58.11 PM.png
Views:	54
Size:	64.8 KB
ID:	2543  
 
Old 01-22-2010, 12:12 AM   #2
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hello,

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,

Eric
 
Old 01-26-2010, 01:44 PM   #3
mitchell7man
Member
 
Registered: Jan 2007
Location: Draper, UT
Distribution: Ubuntu, Windows 10, OSX
Posts: 461

Original Poster
Rep: Reputation: 31
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.
Thanks,
-MJ
 
Old 01-26-2010, 01:53 PM   #4
EricTRA
LQ Guru
 
Registered: May 2009
Location: Gibraltar, Gibraltar
Distribution: Fedora 20 with Awesome WM
Posts: 6,805
Blog Entries: 1

Rep: Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297Reputation: 1297
Hi,

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 main.cf 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 main.cf file you should have something like this:
Code:
myhostname = yournagios.domainname.com
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = yourmailserver.domainname.com, localhost, yournagios.domainname.com
relayhost = 
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = localhost
relay_domains = yournagios.domainname.com
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,

Eric
 
  


Reply

Tags
email, nagios



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
[SOLVED] help required with nagios email notifications NewtoUbuntu8.1 Linux - Newbie 13 10-13-2011 03:10 PM
[SOLVED] Nagios and Postfix Email Notifications cazter2 Linux - Networking 18 11-19-2009 02:31 PM
Nagios Email notifications jackie001 Linux - Newbie 3 11-14-2008 10:58 AM
Nagios e-Mail notifications netmaster3620 Linux - Newbie 1 07-01-2008 07:33 PM
Nagios notifications nuganen Linux - Newbie 1 06-20-2008 02:13 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:31 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration