Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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: <$@localhost.localdomain>... 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=<201209241513.q8OFD0bQ005923@localhost.localdomain>, 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=<201209241514.q8OFEtSo006167@localhost.localdomain>, relay=root@localhost
Sep 24 20:44:56 ubuntubackup-chennai sendmail[6168]: q8OFEuBX006168: from=<root@localhost.localdomain>, size=555, class=0, nrcpts=1, msgid=<201209241514.q8OFEtSo006167@localhost.localdomain>, 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=<root@localhost.localdomain> (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
share|improve this question
4  
Maybe better asked in ServerFault? –  Nate Sep 24 '12 at 16:25
add comment

2 Answers

up vote 3 down vote accepted
+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 karthik...@mycompany.com (desired email). Then restart nagios, apache, and try the custom command notification again.

share|improve this answer
    
Hi @izx Macros are set correctly. I am receiving email for all service notification but not for host.. –  karthick87 Sep 29 '12 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. –  izx Oct 1 '12 at 22:23
    
Hi @izx can we continue this over on chat for faster resolution ?? –  karthick87 Oct 1 '12 at 22:27
    
Hi @izx any update. I have shared the logs to ur mail.. –  karthick87 Oct 3 '12 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 '12 at 15:25
show 3 more comments

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
share|improve this answer
    
Systems hostname is already modified. See my updated question.. I have pasted the contents of hosts file.. –  karthick87 Sep 28 '12 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 '12 at 5:23
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.