Manage Host/Service Notification Commands not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Manage Host/Service Notification Commands not working

Post 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?
sujitt
Posts: 132
Joined: Thu Apr 25, 2013 1:50 pm

Re: Manage Host/Service Notification Commands not working

Post by sujitt »

I have the same issue when I create a contact manually. When I createa contact through create user, it works.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Manage Host/Service Notification Commands not working

Post 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
sujitt
Posts: 132
Joined: Thu Apr 25, 2013 1:50 pm

Re: Manage Host/Service Notification Commands not working

Post by sujitt »

I am on 2014R1.5 . Good to know that this is not fixed yet. Nagios team please fix this issue.
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: Manage Host/Service Notification Commands not working

Post 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.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Manage Host/Service Notification Commands not working

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
emartine
Posts: 660
Joined: Thu Dec 29, 2011 10:47 am

Re: Manage Host/Service Notification Commands not working

Post 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.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Manage Host/Service Notification Commands not working

Post by slansing »

This is covered pretty extensively here:

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