Page 3 of 3

Re: email notification not working on nagios-3.4.4

Posted: Thu Feb 07, 2013 6:21 pm
by jsmurphy
So, it looks like there's no mail client installed... yum install mail? That should install whichever the relevant mail client is. Although that really begs the question how are the messages getting to the root mailbox in the first place...

Try installing mail anyway and give it another test and if successful then make sure the commands definition in Nagios has the correct client and path specified.

Re: email notification not working on nagios-3.4.4

Posted: Thu Feb 07, 2013 6:36 pm
by nagios@ios
yea ...

i installed mailx
yum install mailx

and after that i run

echo "test" | mailx -s "test mail" [email protected]

but so far i didnt receive any email on my account..

Re: email notification not working on nagios-3.4.4

Posted: Thu Feb 07, 2013 6:41 pm
by jsmurphy
Well that's at least progress :)

check your /var/log/maillog after sending a test email now that you have a client installed... it will probably tell you why it couldn't deliver the email or at the very least give a cryptic clue.

Re: email notification not working on nagios-3.4.4

Posted: Thu Feb 07, 2013 6:45 pm
by nagios@ios
here are the latest log from maillog....

Feb 7 18:30:31 nagios sendmail[7761]: r17NUV7M007761: from=root, size=222, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Feb 7 18:30:32 nagios sendmail[7762]: r17NUVWH007762: from=<[email protected]>, size=497, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb 7 18:30:32 nagios sendmail[7761]: r17NUV7M007761: to=[email protected], ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30222, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r17NUVWH007762 Message accepted for delivery)
Feb 7 18:30:32 nagios sendmail[7764]: r17NUVWH007762: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=120497, relay=mailwash46.pair.com. [66.39.2.46], dsn=4.7.1, stat=Deferred: 450 4.7.1 <[email protected]>: Recipient address rejected: Service temporarily unavailable
Feb 7 18:35:11 nagios sendmail[7868]: r17NZBkn007868: from=root, size=426, class=-60, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Feb 7 18:35:11 nagios sendmail[7871]: r17NZBHR007871: from=<[email protected]>, size=719, class=-60, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb 7 18:35:11 nagios sendmail[7868]: r17NZBkn007868: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=138426, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r17NZBHR007871 Message accepted for delivery)
Feb 7 18:35:11 nagios sendmail[7872]: r17NZBHR007871: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=138959, dsn=2.0.0, stat=Sent
Feb 7 18:40:12 nagios sendmail[7986]: r17NeCuv007986: from=root, size=426, class=-60, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Feb 7 18:40:12 nagios sendmail[7990]: r17NeCiP007990: from=<[email protected]>, size=719, class=-60, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Feb 7 18:40:12 nagios sendmail[7986]: r17NeCuv007986: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=138426, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (r17NeCiP007990 Message accepted for delivery)
Feb 7 18:40:12 nagios sendmail[7991]: r17NeCiP007990: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=local, pri=138959, dsn=2.0.0, stat=Sent

Re: email notification not working on nagios-3.4.4

Posted: Thu Feb 07, 2013 6:48 pm
by nagios@ios
i am not very good with linux... so thankyou for having patience with me jsmurphy

Re: email notification not working on nagios-3.4.4

Posted: Thu Feb 07, 2013 6:58 pm
by jsmurphy
No problem, we all have to learn some how ;)

This is the important part of your mail logs:
Feb 7 18:30:32 nagios sendmail[7764]: r17NUVWH007762: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=120497, relay=mailwash46.pair.com. [66.39.2.46], dsn=4.7.1, stat=Deferred: 450 4.7.1 <[email protected]>: Recipient address rejected: Service temporarily unavailable
The mail relay mailwash46.pair.com is rejecting the email... you might have to work with your mail administrator to work out why, at the very least your server is now capable of sending mail. Just ensure that in your Nagios commands.cfg that it is set to use mailx as the mail client as by default Nagios will try to use mail.

Re: email notification not working on nagios-3.4.4

Posted: Thu Feb 07, 2013 8:20 pm
by nagios@ios
Its Working now after installing mailx....

first i received the test mail that you told me to send.

and now i am getting all alerts by emails.

thank you jsmurphy..

really appreciate your help.

Re: email notification not working on nagios-3.4.4

Posted: Thu Feb 07, 2013 9:53 pm
by jsmurphy
You're welcome, glad you got it working!