email notification not working on nagios-3.4.4

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.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: email notification not working on nagios-3.4.4

Post 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.
Last edited by jsmurphy on Thu Feb 07, 2013 6:38 pm, edited 1 time in total.
nagios@ios
Posts: 19
Joined: Wed Feb 06, 2013 5:09 pm

Re: email notification not working on nagios-3.4.4

Post 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..
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: email notification not working on nagios-3.4.4

Post 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.
nagios@ios
Posts: 19
Joined: Wed Feb 06, 2013 5:09 pm

Re: email notification not working on nagios-3.4.4

Post 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
nagios@ios
Posts: 19
Joined: Wed Feb 06, 2013 5:09 pm

Re: email notification not working on nagios-3.4.4

Post by nagios@ios »

i am not very good with linux... so thankyou for having patience with me jsmurphy
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: email notification not working on nagios-3.4.4

Post 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.
nagios@ios
Posts: 19
Joined: Wed Feb 06, 2013 5:09 pm

Re: email notification not working on nagios-3.4.4

Post 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.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: email notification not working on nagios-3.4.4

Post by jsmurphy »

You're welcome, glad you got it working!
Locked