Page 2 of 3

Re: Email notification from Nagios

Posted: Fri May 23, 2014 7:29 am
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"

Re: Email notification from Nagios

Posted: Fri May 23, 2014 7:35 am
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.

Re: Email notification from Nagios

Posted: Fri May 23, 2014 7:55 am
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.

Re: Email notification from Nagios

Posted: Fri May 23, 2014 8:54 am
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.

Re: Email notification from Nagios

Posted: Fri May 23, 2014 9:01 am
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).

Re: Email notification from Nagios

Posted: Fri May 23, 2014 9:08 am
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?

Re: Email notification from Nagios

Posted: Fri May 23, 2014 10:19 am
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.

Re: Email notification from Nagios

Posted: Sat May 24, 2014 7:10 am
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!

Re: Email notification from Nagios

Posted: Tue May 27, 2014 10:36 am
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!

Re: Email notification from Nagios

Posted: Wed May 28, 2014 4:05 am
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
.