Email notification from 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.
kimjaggi
Posts: 44
Joined: Thu Apr 17, 2014 3:56 am

Re: Email notification from Nagios

Post by kimjaggi »

Thanks all for the replies. I found out that I got email from nagios on 14 may but after that no email. I had setup postfix and it was not working so I stopped postfix ,,after stopping it the mail log were like below: But nothing is updating the mail havent been sent to my mailbox even there are services which are critical:

Code: Select all

May 23 11:51:58 EIS0202 postfix/qmgr[7661]: 475291003B0: from=<>, size=2995, nrcpt=1 (queue active)
May 23 11:51:58 EIS02 postfix/qmgr[7661]: 57A70100276: from=<[email protected]>, size=689, nrcpt=1 (queue active)
May 23 11:51:58 EIS02 postfix/qmgr[7661]: 6877D100333: from=<[email protected]>, size=974, nrcpt=1 (queue active)
May 23 11:51:58 EIS02 postfix/qmgr[7661]: 6B3E71002D0: from=<[email protected]>, size=689, nrcpt=1 (queue active)
May 23 11:51:58 EIS02 postfix/local[7664]: 475291003B0: to=<[email protected]>, relay=local, delay=21639, delays=21639/0.01/0/0.04, dsn=2.0.0, status=sent (delivered to mailbox)
May 23 11:51:58 EIS02 postfix/qmgr[7661]: 475291003B0: removed
May 23 11:52:09 EIS02 postfix/postfix-script[7767]: stopping the Postfix mail system
May 23 11:52:09 EIS02 postfix/master[7658]: terminating on signal 15
and nagios logs says this

Code: Select all

[1400846545] SERVICE ALERT: DEISMSW03;fans;CRITICAL;SOFT;3;OK: fan1 unit1 normal.  OK: fan2 unit1 normal.  OK: fan1 unit2 normal.  OK: fan2 unit2 normal.  OK: fan1 unit3 normal.  OK: fan2 unit3 normal.  CRITICAL: fan1 unit4 critical! Please shutdown the unit!  CRITICAL: fan2 unit4 critical! Please shutdown the unit!
[1400846604] SERVICE ALERT: DEISMSW03;fans;CRITICAL;HARD;4;OK: fan1 unit1 normal.  OK: fan2 unit1 normal.  OK: fan1 unit2 normal.  OK: fan2 unit2 normal.  OK: fan1 unit3 normal.  OK: fan2 unit3 normal.  CRITICAL: fan1 unit4 critical! Please shutdown the unit!  CRITICAL: fan2 unit4 critical! Please shutdown the unit!
[1400847303] HOST NOTIFICATION: nagiosadmin;SRA01;DOWN;notify-host-by-email;PING CRITICAL - Packet loss = 100%
I did

Code: Select all

echo "test" | mail -s "test mail" [email protected]
(using my email address) but no email came.

when I restarted started and stopped the postfix it agin gave me same error "Connection timed out"
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Email notification from Nagios

Post by eloyd »

You need something listening on port 25 to accept mail. Postfix is one such program, sendmail is another. If you stopped postfix, then nothing is listening and therefore, no mail can be sent to that machine.

You need to fix your postfix configuration and get that running before anything related to Nagios can be fixed.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
kimjaggi
Posts: 44
Joined: Thu Apr 17, 2014 3:56 am

Re: Email notification from Nagios

Post by kimjaggi »

Thanks Eric for the reply,

I think the same. It was working before but when I installed postfix, everything stopped working. Something surely is messed up. I am not sure if I can bring the config back. But will try and see if that works.
Is it possible to remove postfix and then try the default ones. because it was working before.
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Email notification from Nagios

Post by eloyd »

This is very hard to help diagnose remotely, since any number of things could be wrong with your postfix installation.

My suggestion is to switch to a postfix support forum for the time being and see if you can get that fixed. Luckily, postfix has a huge support base so you should be able to find someone who can help you quickly.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Stuart Watts
Posts: 40
Joined: Wed Sep 25, 2013 7:01 am

Re: Email notification from Nagios

Post by Stuart Watts »

Postfix is the default MTA in CentOS 6.5. I'm not sure how you might have installed it again! Still, the issue is Postfix is timing out trying to get to port 25 on a remote mail server, and that's normally network related (a firewall is stopping you).
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: Email notification from Nagios

Post by eloyd »

Yes, that's right. I'd lost track of that.

I am still not clear on whether or not the mail server that you are sending to (since you hide your email address in your log file, I can only see the IP address) is yours or someone else's. Please tell me what happens when you do this from your command line:

Code: Select all

$ telnet 37.202.5.178 25
And who owns 37.202.5.178 25? Is it your company or someone else?
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: Email notification from Nagios

Post by slansing »

I agree with eloyd and Stuart Watts, this issue can likely be chalked up to interference in your network at some point. Let us know what the results of the above telnet are.
kimjaggi
Posts: 44
Joined: Thu Apr 17, 2014 3:56 am

Re: Email notification from Nagios

Post by kimjaggi »

reply of Telnet is

Code: Select all

Trying 37.202.5.178.....
I will check the firewall and check on postfix forums if I could get something!
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Email notification from Nagios

Post by sreinhardt »

You might also want to be sure that your ISP is not blocking port 25, if that host is supposed to accept email from the nagios system. Otherwise, sounds good, let us know how it goes!
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
kimjaggi
Posts: 44
Joined: Thu Apr 17, 2014 3:56 am

Re: Email notification from Nagios

Post by kimjaggi »

I removed postfix and tried echo and got below error:

Code: Select all

[root@MON02 sbin]# echo "test" | mail -s "test mail" [email protected]

Code: Select all

/usr/sbin/sendmail: No such file or directory
"/root/dead.letter" 9/229
. . . message not sent
.
Locked