Page 1 of 2
Email Notifications Don't Work
Posted: Fri Mar 29, 2019 9:16 am
by gpanou
Hello,
I am facing an issue with a fresh VM NagiosXI Installation, after temporarily disabling notifications through monitoring engine status and re-enabling I am not getting any email notifications.
Email settings are correct as I am able to get all the test emails (notification and email settings test).
I tried to send forced notifications and even though they get displayed in the core view:(sample)
AU_Firewall_2 Log Partition CUSTOM (CRITICAL) 03-29-2019 14:53:35 nagiosadmin xi_service_notification_handler SNMP CRITICAL - Slot-1 Management Log Partition *3530056* KB
They never get emailed.
All the services are configured having notifications enabled and are directly linked to all the users.
All the users have their notifications enabled and their notification method set by email.
The core contacts linked to the users have their notification commands set to xi_host_notification_handler and service respectively.
The emails are sent via smtp without auth or security.
In tail -F /usr/local/nagiosxi/tmp/phpmailer.log
there seem to be no entries regarding forced or not notifications.
Thank you for your time,
George Panou
Re: Email Notifications Don't Work
Posted: Fri Mar 29, 2019 12:57 pm
by npolovenko
Hello,
@gpanou. Please run the following command to clear out email tables in the database:
echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | mysql -uroot -pnagiosxi nagiosxi
If notifications don't resume please trigger a few alerts from the GUI and then take a screenshot of the Event Log and upload it in the ticket.
Untitled.png
Also, you can go to the Admin Menu, then click on Manage Email Settings in the left column and check the Debugging option:
This will enable debug logging for phpmailer emails. The log is located here: /usr/local/nagiosxi/tmp/phpmailer.log
Sendmail log location depends on your system (examples: /var/log/maillog or /var/log/mail.log)
Then after email notifications were supposed to go out you can look into those log files and let us know if there are any errors.
Re: Email Notifications Don't Work
Posted: Mon Apr 01, 2019 2:43 am
by gpanou
Still no notifications, the logs where enabled, there dont seem to be any errors, here is the event log:
Code: Select all
Type Date / Time Information
Service Notification 2019-04-01 10:34:23 SERVICE NOTIFICATION: nagiosadmin;AU_Firewall_2;Log Partition;CUSTOM (CRITICAL);xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *3716536* KB;Nagios Admin;test notification
Service Notification 2019-04-01 10:34:23 SERVICE NOTIFICATION: mntouros;AU_Firewall_2;Log Partition;CUSTOM (CRITICAL);xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *3716536* KB;Nagios Admin;test notification
Service Notification 2019-04-01 10:34:23 SERVICE NOTIFICATION: algo;AU_Firewall_2;Log Partition;CUSTOM (CRITICAL);xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *3716536* KB;Nagios Admin;test notification
Service Notification 2019-04-01 10:30:53 SERVICE NOTIFICATION: nagiosadmin;AU_Firewall_2;Log Partition;CRITICAL;xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *3716536* KB
Service Notification 2019-04-01 10:30:53 SERVICE NOTIFICATION: mntouros;AU_Firewall_2;Log Partition;CRITICAL;xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *3716536* KB
Service Notification 2019-04-01 10:30:53 SERVICE NOTIFICATION: algo;AU_Firewall_2;Log Partition;CRITICAL;xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *3716536* KB
Service Critical 2019-04-01 10:29:27 SERVICE ALERT: HP-Stack-BuildB;4/37 Status;CRITICAL;HARD;5;CRITICAL: Interface 4/37 (index 193) is down.
Service Notification 2019-04-01 10:29:27 SERVICE NOTIFICATION: nagiosadmin;HP-Stack-BuildB;4/37 Status;CRITICAL;xi_service_notification_handler;CRITICAL: Interface 4/37 (index 193) is down.
Service Notification 2019-04-01 10:29:27 SERVICE NOTIFICATION: mntouros;HP-Stack-BuildB;4/37 Status;CRITICAL;xi_service_notification_handler;CRITICAL: Interface 4/37 (index 193) is down.
Service Notification 2019-04-01 10:29:27 SERVICE NOTIFICATION: algo;HP-Stack-BuildB;4/37 Status;CRITICAL;xi_service_notification_handler;CRITICAL: Interface 4/37 (index 193) is down.
Service Critical 2019-04-01 10:28:29 SERVICE ALERT: HP-Stack-BuildB;4/37 Status;CRITICAL;SOFT;4;CRITICAL: Interface 4/37 (index 193) is down.
Service Critical 2019-04-01 10:27:30 SERVICE ALERT: HP-Stack-BuildB;4/37 Status;CRITICAL;SOFT;3;CRITICAL: Interface 4/37 (index 193) is down.
Service Recovery 2019-04-01 10:26:58 SERVICE ALERT: AU_Offices1_SW;Ping;OK;SOFT;2;OK - 192.168.212.1: rta 403.035ms, lost 0%
Service Critical 2019-04-01 10:26:32 SERVICE ALERT: HP-Stack-BuildB;4/37 Status;CRITICAL;SOFT;2;CRITICAL: Interface 4/37 (index 193) is down.
Service Warning 2019-04-01 10:26:00 SERVICE ALERT: AU_Offices1_SW;Ping;WARNING;SOFT;1;WARNING - 192.168.212.1: rta 402.856ms, lost 80%
Service Critical 2019-04-01 10:25:34 SERVICE ALERT: HP-Stack-BuildB;4/37 Status;CRITICAL;SOFT;1;CRITICAL: Interface 4/37 (index 193) is down.
Service Notification 2019-04-01 10:19:44 SERVICE NOTIFICATION: nagiosadmin;AU_Firewall_1;Log Partition;CRITICAL;xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *2672252* KB
Service Notification 2019-04-01 10:19:44 SERVICE NOTIFICATION: mntouros;AU_Firewall_1;Log Partition;CRITICAL;xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *2672252* KB
Service Notification 2019-04-01 10:19:44 SERVICE NOTIFICATION: algo;AU_Firewall_1;Log Partition;CRITICAL;xi_service_notification_handler;SNMP CRITICAL - Slot-1 Management Log Partition *2672252* KB
Service Notification 2019-04-01 10:19:44 SERVICE NOTIFICATION: George Panou;AU_Firewall_1;Log Partition;CRITICAL;notify-service-by-email;SNMP CRITICAL - Slot-1 Management Log Partition *2672252* KB
Host Recovery 2019-04-01 09:59:13 HOST ALERT: AU_Cameras_SW;UP;SOFT;1;OK - 192.168.212.5: rta 403.443ms, lost 0%
Host Down 2019-04-01 09:59:00 HOST ALERT: AU_Cameras_SW;DOWN;SOFT;1;CRITICAL - 192.168.212.5: rta nan, lost 100%
Service Recovery 2019-04-01 09:58:35 SERVICE ALERT: HP-5412-BuildC;F13 Status;OK;HARD;5;OK: Interface F13 (index 173) is up.
Service Notification 2019-04-01 09:58:35 SERVICE NOTIFICATION: nagiosadmin;HP-5412-BuildC;F13 Status;OK;xi_service_notification_handler;OK: Interface F13 (index 173) is up.
Service Notification 2019-04-01 09:58:35 SERVICE NOTIFICATION: mntouros;HP-5412-BuildC;F13 Status;OK;xi_service_notification_handler;OK: Interface F13 (index 173) is up.
Service Notification 2019-04-01 09:58:35 SERVICE NOTIFICATION: algo;HP-5412-BuildC;F13 Status;OK;xi_service_notification_handler;OK: Interface F13 (index 173) is up.
Terminal log
Code: Select all
[04-01-2019 10:29:33] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:29:33] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:31:02] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:31:02] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:31:02] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:34:29] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:34:30] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:34:30] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
Test notifications and email test work.
Re: Email Notifications Don't Work
Posted: Mon Apr 01, 2019 2:47 am
by gpanou
When I try with sendmail I get this error:
Code: Select all
[04-01-2019 10:46:23] Could not instantiate mail function. (method=sendmail), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:46:23] Could not instantiate mail function. (method=sendmail), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
Re: Email Notifications Don't Work
Posted: Mon Apr 01, 2019 8:07 am
by scottwilkerson
Code: Select all
SMTP code: 503 Additional SMTP info: 5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
SMTP code: 503 Additional SMTP info: 5.5.2 (method=smtp;host=192.68.7.27;port=25;security=none), Referer: includes/components/xicore/xicore.inc.php > Event Handler Notification Email
[04-01-2019 10:31:02] The following From address failed: [email protected] : MAIL FROM command failed,Send hello first
This from address is failing
[email protected]
Is it a valid email address?
Re: Email Notifications Don't Work
Posted: Mon Apr 01, 2019 10:30 am
by gpanou
Yes it is a valid address, the mail goes through a relay
Re: Email Notifications Don't Work
Posted: Mon Apr 01, 2019 10:44 am
by scottwilkerson
gpanou wrote:Yes it is a valid address, the mail goes through a relay
You are going to want to check the logs on 192.68.7.27 SMTP server because it is giving the error message
Re: Email Notifications Don't Work
Posted: Mon Apr 01, 2019 10:52 am
by gpanou
Code: Select all
,503,5.5.2SMTP server error: MAIL FROM command failed Detail: Send hello first
It seems that the Exchange server is returning 503 because Nagios does not send "helo" command before mail from:
Re: Email Notifications Don't Work
Posted: Mon Apr 01, 2019 11:01 am
by gpanou
initializing the variable :
public $Helo = 'helo';
in
/usr/local/nagiosxi/html/includes/phpmailer/class.phpmailer.php
the emails get sent
Re: Email Notifications Don't Work
Posted: Mon Apr 01, 2019 11:13 am
by scottwilkerson
This is bizarre, I've never seen this, but maybe because you are using IP vs. hostname.