Monday, April 29, 2024
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 10007  / 2 Years ago, mon, september 26, 2022, 12:10:40

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

More From » notification

 Answers
7

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.


[#35350] Tuesday, September 27, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ncharm

Total Points: 255
Total Questions: 105
Total Answers: 118

Location: Virgin Islands (U.S.)
Member since Sat, May 6, 2023
1 Year ago
ncharm questions
;