Page 1 of 1

Only some contacts being alerted

Posted: Mon Jan 30, 2017 6:31 pm
by drakedts
Hello. I'm trying to track down an alerting issue. I have 4 contacts assigned to a group that should be alerted on host and service problems. But only 3 of the contacts are being alerted. I have checked the contacts.cfg file on the backend to confirm the contacts are configured identically. The Nagios GUI shows alerts were sent to all 4 contacts. Nagios logs show the alert was sent. But... the system's maillog only shows messages going out for 3 of the contacts.

How can i figure out exactly what is going on?

The contact that is not working is named "oncall". It is an e-mail address that goes to a pager. I can see alerts in /usr/local/nagios/var/nagios.log, for example:

Code: Select all

[1485468150] SERVICE NOTIFICATION: oncall;mobile;Disk Space via NRPE;CRITICAL;xi_service_notification_handler;DISK CRITICAL - free space: / 160 MB (1% inode=81%):
[1485469641] SERVICE NOTIFICATION: oncall;mobile;Disk Space via NRPE;FLAPPINGSTART (OK);xi_service_notification_handler;DISK OK
[1485471229] SERVICE NOTIFICATION: oncall;mobile;Disk Space via NRPE;FLAPPINGDISABLED (CRITICAL);xi_service_notification_handler;DISK CRITICAL - free space: /tmp 47 MB (2% inode=99%):
I tried turning on debug logging, and can confirm that Nagios thinks it is sending alerts to all 4 contacts:

Code: Select all

[1485471229.857779] [032.0] [pid=24052] ** Service Notification Attempt ** Host: 'mobile', Service: 'Disk Space via NRPE', Type: FLAPPINGDISABLED, Options: 0, Current State: 2, Last Notification: Wed Dec 31 18:00:00 1969
[1485471229.857802] [032.0] [pid=24052] Notification viability test passed.
[1485471229.857806] [032.1] [pid=24052] Current notification number: 0 (unchanged)
[1485471229.857819] [032.1] [pid=24052] Service notification will NOT be escalated.
[1485471229.857822] [032.1] [pid=24052] Adding normal contacts for service to notification list.
[1485471229.858182] [032.0] [pid=24052] 4 contacts were notified.
But when i search the system's /var/log/maillog, i only see messages for the 3 contacts that work, not for the oncall one. I have confirmed that i can send messages at the command line (using "mail") to the oncall contact's e-mail address.

Support info: Server is Red Hat Enterprise Linux 7 (x86_64). Nagios XI was installed manually.

Re: Only some contacts being alerted

Posted: Mon Jan 30, 2017 6:42 pm
by drakedts
Not sure if it is needed, but here's some more specific info:
  • The Contact Group that all 4 contacts are in is named "linux-admins".
  • The 4 contacts that are in linux-admins are: 000164518, 000214567, 000242963, oncall.
  • "oncall" is the contact that has problems; the other 3 receive alerts as expected.

Re: Only some contacts being alerted

Posted: Tue Jan 31, 2017 10:28 am
by rkennedy
A couple questions here:
1. Is 'oncall' a user in the XI system? User accounts are required when using the xi_host/service_notification_handler's
2. Navigate to Admin -> Manage Users -> Find 'oncall' and masquerade as the user. Now, click 'oncall' in the top right, and make sure all of the notification options / preferences are turned on / enabled. This was setup to allow users to control their notifications further, and is why a user account is required.

Re: Only some contacts being alerted

Posted: Tue Jan 31, 2017 7:10 pm
by drakedts
Hello and thanks for getting back to me!

"oncall" is not a user, just a contact. I must have overlooked the user account requirement. If i just switch the notification commands to notify-host-by-email and notify-service-by-email, will that allow notifications to go out? We don't actually want a user created for that contact unless it is mandatory to do so, nor do we need users to be able to set their own time periods.

If switching to notify-*-by-email will fix it, is there any reason/benefit to using the xi_*_notification_handlers?

Re: Only some contacts being alerted

Posted: Wed Feb 01, 2017 10:16 am
by rkennedy
drakedts wrote:Hello and thanks for getting back to me!

If i just switch the notification commands to notify-host-by-email and notify-service-by-email, will that allow notifications to go out?

If switching to notify-*-by-email will fix it, is there any reason/benefit to using the xi_*_notification_handlers?
Yes - but, it could get filtered because that will send using only sendmail. (this happens at times.) The xi_*_notification_handlers respect the 'Manage Email Settings' page though. If you wanted to, you could simply create a user as well, should sendmail have problems.

Re: Only some contacts being alerted

Posted: Wed Feb 01, 2017 8:51 pm
by drakedts
Ah, that's helpful info. In the "Manage Email Settings" page we have XI set to use Sendmail. With the mail architecture we've built out, "sendmail" (Postfix, actually) will be more reliable than SMTP. Unless i'm misunderstanding something, it seems that in our case, there is no disadvantage to using the notify-*-by-email handlers. I'll switch all our contacts over to those. Thank you!

Re: Only some contacts being alerted

Posted: Thu Feb 02, 2017 10:10 am
by rkennedy
You're understanding correctly. Let us know if anything further comes up!

Re: Only some contacts being alerted

Posted: Thu Feb 02, 2017 2:46 pm
by drakedts
Thank you for clarifying the alert options for me! This thread can be closed.

Re: Only some contacts being alerted

Posted: Thu Feb 02, 2017 2:53 pm
by rkennedy
You're welcome! Feel free to open a new thread should you have questions in the future.