Page 1 of 1

Manage Host/Service Notification Commands not working

Posted: Tue Jan 13, 2015 1:25 pm
by emartine
I created a fake alert to test notification going out to users. They worked when I was using the contact alert settings:

Manage Host Notification Command:
notify-host-by-email
Manage Service Notification Command:
notify-service-by-email

Nagios shows that the alerts went out and the nagios Event log shows the service going out and in /var/log/maillog I see the nagiosxi postfix/smtp status as being sent and accepted for delivery and the alerts are received.

When I changed this to use the:

Notification Settings Management Email Notifications and I set the contact alert settings to:

Manage Host Notification Command:
xi_host_notification_handler
Manage Service Notification Command:
xi_service_notification_handler

Nagios shows that the alerts went out and the nagios Event log shows the service going out. But I see no entries for any postfix/smtp entries being sent or accepted for delivery and no alert messages are received.


If I change the contact alert settings back to:

Manage Host Notification Command:
notify-host-by-email
Manage Service Notification Command:
notify-service-by-email


It works again.

Any idea what might be going on?

Re: Manage Host/Service Notification Commands not working

Posted: Tue Jan 13, 2015 2:27 pm
by sujitt
I have the same issue when I create a contact manually. When I createa contact through create user, it works.

Re: Manage Host/Service Notification Commands not working

Posted: Tue Jan 13, 2015 4:39 pm
by emartine
I just tested this. I created a contact and added:

Manage Host Notification Command:
xi_host_notification_handler
Manage Service Notification Command:
xi_service_notification_handler

This didn't receive notifications.

When I created an account and checked the box for create as a contact, it worked

Manage Host Notification Command:
xi_host_notification_handler
Manage Service Notification Command:
xi_service_notification_handler

I am using Nagios XI 2014R2.1

Re: Manage Host/Service Notification Commands not working

Posted: Tue Jan 13, 2015 4:46 pm
by sujitt
I am on 2014R1.5 . Good to know that this is not fixed yet. Nagios team please fix this issue.

Re: Manage Host/Service Notification Commands not working

Posted: Tue Jan 13, 2015 5:33 pm
by sreinhardt
This is not actually an issue. Users have very specific settings within the postgres database that the xi notification handlers require. Creating just a contact and not an associated user, will almost always fail to notify your recipient. If you do have the contacts associated with a user, emails assigned to them, and the email settings under the admin tab configured correctly, email should flow properly. It should be noted, that it will not create a postfix or maillog entry as it does not use either for it's functionality, but instead is entirely done through php.

Re: Manage Host/Service Notification Commands not working

Posted: Tue Jan 13, 2015 5:36 pm
by abrist
Nagios XI user accounts that need notification support should be linked to a contact. This is easiest done by creating the user and making sure the create monitoring contact box is checked. This allows the user and its associated contact to use the XI notification handlers which will use the user's settings and allow smtp support (through phpmailer) for notifications on that account (if smtp is configured in Admin--> Manage email settings).

The core notify handlers only work (oob) with the sendmail client. This is expected. You can use pure core contacts (those not associated to an xi user) with the phpmail smtp settings by configuring new notification commands to use phpmailer. See:

http://assets.nagios.com/downloads/nagi ... Mailer.pdf

Note: You should find some useful definitions in the above linked doc as well.

Re: Manage Host/Service Notification Commands not working

Posted: Wed Jan 14, 2015 4:53 pm
by emartine
My point in using the xi handlers is to have the rapid response and nagios xi page URLs included in the notification. If it can't include the URLs it is pointless. Regular defined host notify commands can work just as well. I've read though and used the PDF to see if it the settings would work and althought it uses a nagios XI email generated throught php... no URLs go out with the notifications.

IF :
Creating just a contact and not an associated user, will almost always fail to notify your recipient.
Then:
This should be stated in the same user notification management section that states:

Note: Contacts must have the "xi_host_notification_handler" and "xi_service_notification_handler" commands defined for the selected contacts in order for these notification settings to be applied.

It says "contacts" and not "user accounts". This is confusing to say the least and there should be more documentation in this section stating the remaining requirements.

Re: Manage Host/Service Notification Commands not working

Posted: Wed Jan 14, 2015 5:55 pm
by slansing
This is covered pretty extensively here:

http://assets.nagios.com/downloads/nagi ... ios-XI.pdf