3

Recently I am not getting any email notification in nagios. I have tested it by sending emails manually from root user and nagios user and I have got the email successfully. But I am not any email alerts in case any issue so that I tested it by sending custom host notification from WEBUI, something seems to be wrong in the log. I hope someone can help me. Please find the logs below:

From Nagios Frontend Webui: (Tested it by sending custom host notification)

Sep 24 20:43:00 ubuntubackup-chennai sendmail[5923]: q8OFD0bP005923: Authentication-Warning: localhost.localdomain: nagios set sender to nagiosub@****.com using -r
Sep 24 20:43:00 ubuntubackup-chennai sendmail[5923]: q8OFD0bP005923: from=nagiosub@****.com, size=436, class=0, nrcpts=1, msgid=<5060787c.cbQWUMyq0G8H5/8r%nagiosub@****.com>, relay=nagios@localhost                   
Sep 24 20:43:00 ubuntubackup-chennai sendmail[5924]: q8OFD0JV005924: <[email protected]>... User unknown
Sep 24 20:43:00 ubuntubackup-chennai sendmail[5923]: q8OFD0bP005923: to=$, ctladdr=nagiosub@****.com (496/492), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30436, relay=[127.0.0.1] [127.0.0.1], dsn=5.1.1, stat=User unknown
Sep 24 20:43:00 ubuntubackup-chennai sendmail[5924]: q8OFD0JV005924: from=<nagiosub@****.com>, size=436, class=0, nrcpts=0, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Sep 24 20:43:00 ubuntubackup-chennai sendmail[5923]: q8OFD0bP005923: q8OFD0bQ005923: DSN: User unknown
Sep 24 20:43:01 ubuntubackup-chennai sendmail[5924]: q8OFD0JX005924: from=<>, size=2374, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Sep 24 20:43:01 ubuntubackup-chennai sendmail[5923]: q8OFD0bQ005923: to=nagiosub@****.com, delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=31460, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8OFD0JX005924 Message accepted for delivery)
Sep 24 20:43:02 ubuntubackup-chennai sendmail[5926]: q8OFD0JX005924: to=<nagiosub@****>, delay=00:00:02, xdelay=00:00:01, mailer=relay, pri=122374, relay=smtp10.netcore.co.in. [202.162.229.32], dsn=2.0.0, stat=Sent (_SMR_smtp12.netcore.co.in Ok: queued as 0797E19957)

As Nagios User From Terminal:

Sep 24 20:44:04 ubuntubackup-chennai sendmail[6067]: q8OFE4Th006067: Authentication-Warning: localhost.localdomain: nagios set sender to nagiosub@****.com using -r
Sep 24 20:44:04 ubuntubackup-chennai sendmail[6067]: q8OFE4Th006067: from=nagiosub@****.com, size=341, class=0, nrcpts=1, msgid=<506078bc.5x+q5X78H8WjVw2J%nagiosub@****.com>, relay=nagios@localhost
Sep 24 20:44:04 ubuntubackup-chennai sendmail[6068]: q8OFE4WN006068: from=<nagiosub@****.com>, size=614, class=0, nrcpts=1, msgid=<506078bc.5x+q5X78H8WjVw2J%nagiosub@****>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Sep 24 20:44:05 ubuntubackup-chennai sendmail[6067]: q8OFE4Th006067: to=karthick@****.com, ctladdr=nagiosub@**** (496/492), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=30341, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8OFE4WN006068 Message accepted for delivery)
Sep 24 20:44:05 ubuntubackup-chennai sendmail[6070]: q8OFE4WN006068: to=<karthick@****.com>, delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=120614, relay=smtp10.netcore.co.in. [202.162.229.32], dsn=2.0.0, stat=Sent (_SMR_smtp9.netcore.co.in Ok: queued as 517CEF7E69)

As Root user from Terminal:

Sep 24 20:44:56 ubuntubackup-chennai sendmail[6167]: q8OFEtSo006167: from=root, size=281, class=0, nrcpts=1, msgid=<[email protected]>, relay=root@localhost
Sep 24 20:44:56 ubuntubackup-chennai sendmail[6168]: q8OFEuBX006168: from=<[email protected]>, size=555, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
Sep 24 20:44:56 ubuntubackup-chennai sendmail[6167]: q8OFEtSo006167: to=karthick@****, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:00, mailer=relay, pri=30281, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (q8OFEuBX006168 Message accepted for delivery)
Sep 24 20:44:56 ubuntubackup-chennai sendmail[6170]: q8OFEuBX006168: to=<karthick@****.com>, ctladdr=<[email protected]> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=120555, relay=smtp10.netcore.co.in. [202.162.229.32], dsn=2.0.0, stat=Sent (_SMR_smtp12.netcore.co.in Ok: queued as 727A519942)

Note:

  • Mail received from root user & nagios user but not from Nagios WEBUI.

Entry in hosts file: /etc/hosts

127.0.0.1               localhost.localdomain localhost ubuntubackup
::1             localhost6.localdomain6 localhost6
1
  • 4
    Maybe better asked in ServerFault?
    – Nate
    Sep 24, 2012 at 16:25

2 Answers 2

4
+500

The problem appears to be that the $CONTACTEMAIL$ macro is not being set correctly.

Backup the /etc/nagios3/commands.cfg file, and then open it in your favorite editor, replacing all instances of $CONTACTEMAIL$ with [email protected] (desired email). Then restart nagios, apache, and try the custom command notification again.

7
  • Hi @izx Macros are set correctly. I am receiving email for all service notification but not for host..
    – karthick87
    Sep 29, 2012 at 11:18
  • Can you pastebin the current commands.cfg file? And the problem is basically that host notifications for ubuntubackup are not working, but service notifications are? Please also paste extract of mail.log showing the transactions for a successful service notification performed by nagios (not by you via root or as nagios user). Thanks.
    – ish
    Oct 1, 2012 at 22:23
  • Hi @izx can we continue this over on chat for faster resolution ??
    – karthick87
    Oct 1, 2012 at 22:27
  • Hi @izx any update. I have shared the logs to ur mail..
    – karthick87
    Oct 3, 2012 at 11:54
  • Hi @izx Kindly check and share your findings as well as fix. Thank you. Bounty gonna end. So accepting this as the answer. If you find the answer just elaborate it..
    – karthick87
    Oct 3, 2012 at 15:25
0

The problem is that your hostname is localhost.localdomain, which is fixed up by the sendmail command line but not by the webui.

To fix it, change your system's hostname. If you don't know where this is stored do

cd /etc
grep localdomain
2
  • Systems hostname is already modified. See my updated question.. I have pasted the contents of hosts file..
    – karthick87
    Sep 28, 2012 at 6:50
  • You modified hosts file is not correct. The line should be 127.0.0.1 ubuntubackup.Yourdomain.tld ubuntubackup
    – Floyd
    Sep 29, 2012 at 5:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .