Mail settings nagios

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
ericosman
Posts: 20
Joined: Thu Oct 30, 2014 4:11 am

Mail settings nagios

Post by ericosman »

Hi,

I finaly have my Nagios up and running as i want ( thanks to you guys! )
But now at this moment Nagios will not sent real mails....
Could anyone tell me where i can change the mail settings ?

We use a Exchange 2010 for the mail.

Thanks in advance!
Ramdas
Posts: 3
Joined: Tue Feb 26, 2013 10:36 pm

Re: Mail settings nagios

Post by Ramdas »

Hi,

Try to send a test e-mail from Nagios server to your inbox first, If it working then you should check your command configuration.

Code: Select all

/bin/mail -s "subject" [email protected]
<Body>
.
If still you not receiving an e-mail to your inbox then try followings on the Nagios server. (I am assuming that you may using CentOS/RHEL)

a.Install the following packages,

Code: Select all

# yum install sendmail sendmail-cf
b.There is no need to start the Sendmail in Listening mode, because Nagios server simply sent the e-mail notification and it will not receive any e-mail.
so, Edit the file /etc/sysconfig/sendmail and modify the line:

Code: Select all

DAEMON=no 
c.Configure the Mail submission. edit the /etc/mail/submit.mc file & find and edit the following line as follows,

Code: Select all

FEATURE(`msp',`<SMTP-Mail Relay server>')

d.Run the following command to update the /etc/mail/submit.cf file

Code: Select all

# m4 /etc/mail/submit.mc > /etc/mail/submit.cf
e.Restart the “sendmail” service for the configuration changes to be effective:

Code: Select all

# /etc/init.d/sendmail restart
By
_Ram
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Mail settings nagios

Post by rhassing »

Hello Eric,

Are you running Nagios on Linux?
If you are, which distribution are you using? (CentOS, Red Hat, Fedora, Ubuntu, etc.)
Do you know which MTA is running, Postfix or Sendmail?

Actually this has not much to do with Nagios, but more with Linux in general :-)

Best regards,
Rob
Rob Hassing
Image
ericosman
Posts: 20
Joined: Thu Oct 30, 2014 4:11 am

Re: Mail settings nagios

Post by ericosman »

rhassing wrote:Hello Eric,

Are you running Nagios on Linux?
If you are, which distribution are you using? (CentOS, Red Hat, Fedora, Ubuntu, etc.)
Do you know which MTA is running, Postfix or Sendmail?

Actually this has not much to do with Nagios, but more with Linux in general :-)

Best regards,
Rob
Hi Rob,

I'm using Centos 6.4.
I cant give anymore information because i dont know what is running.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Mail settings nagios

Post by eloyd »

Type this as root:

Code: Select all

lsof -i:25
If it says that the command is not found, then do this first and then type the lsof command again:

Code: Select all

yum -y install lsof
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
ericosman
Posts: 20
Joined: Thu Oct 30, 2014 4:11 am

Re: Mail settings nagios

Post by ericosman »

I got this : :)

Code: Select all

[root@Nagios ~]# lsof -i:25
COMMAND  PID USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
master  2264 root   12u  IPv4  14141      0t0  TCP localhost:smtp (LISTEN)
master  2264 root   13u  IPv6  14143      0t0  TCP localhost:smtp (LISTEN)
You have new mail in /var/spool/mail/root
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Mail settings nagios

Post by eloyd »

That's part of postfix.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Mail settings nagios

Post by slansing »

I highly recommend you follow this guide, it should get you on the right track and cover most if not all of the requirements you have:

http://www.telnetport25.com/2012/02/con ... gios-core/
User avatar
rhassing
Posts: 416
Joined: Sat Oct 05, 2013 10:29 pm
Location: Netherlands

Re: Mail settings nagios

Post by rhassing »

For postfix you could do the following:
Routing all mails to a smarthost (which could be you exchange server):

As it is CentOS, I assume the postfix config files live in /etc/postfix/main.cf

In/etc/postfix/main.cf add the line:

relayhost = <your exchange ip address>:25
Rob Hassing
Image
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Mail settings nagios

Post by abrist »

OP: Have any of the proceeding suggestions worked for you?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked