Page 1 of 2

Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 10:55 am
by nveeder
Nagios XI 2012R1.6
RHEL 5.8 x64

If I create a Nagios XI user and select the option to Create as a Monitoring Contact, do settings for the corresponding Nagios Core contact still get applied? For example, if I use the Contacts page in CCM to edit the new core contact's Addon Address fields should I expect that notifications are sent to each email address I've added? The core contact is using the xi_host_notification_handler and xi_service_notification_handler notification commands from the xi_generic_contact template.
It seems that only the email address that is set for the Nagios XI User receives notifications. I've read the XI_Users_And_Contacts.pdf, but am not understanding this point.

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 11:19 am
by lmiltchev
Nagios XI users are set with the "xi_host_notification_handler" and "xi_service_notification_handler". If you need to change the user's email, you should do it by going to:

Admin->Manage Users->Edit (not via CCM->Contacts->Modify)

In contrast, contacts use "notify-host-by-email" and "notify-service-by-email" handlers. The "XI_Users_And_Contacts.pdf" document, just explains how to create and break relationships between contacts and users in XI.

Note: Users can modify their notifications options, but contacts cannot.

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 11:25 am
by slansing
If the contact is assigned to the monitoring object "host/service" etc. it's notification settings will be used, you will also need to use the following notification handlers for contacts:

notify-host-by-email and notify-service-by-email

You can view our documentation on the differences between contacts and users here:

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

And also our FAQ section here, under Contacts:

http://support.nagios.com/wiki/index.php/Nagios_XI:FAQs

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 12:17 pm
by nveeder
I understand now that the Addon Address fields on the Contact page will not be applied if the contact is set to use "xi_host_notification_handler" and "xi_service_notification_handler". As Admin->Manage Users->Edit only allows setting one email address, that will not accomplish what I need.
The reason I was using Nagios XI Users is that this seemed to be the simplest way to customize notifications for different contacts. If I stop using the xi notification handlers for these contacts, how do I customize notifications on a per contact basis? I guess I would need to make new notification commands for each custom notification and assign those to the appropriate contacts, correct?

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 12:46 pm
by abrist
You would not need to make new commands unless you needed a unique command per user. You could use the notify-*-by-email, but by doing so you will break the XI user management for that contact.

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 1:00 pm
by nveeder
How do I customize notifications on a per contact basis?

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 1:07 pm
by slansing
How do I customize notifications on a per contact basis?
You can modify the contacts be navigating to:

Configure > Core Config Manager > Contacts

There you should see a listing of your defined contacts, simply open one, make the changes, then click save, and Apply Configuration on the page it returns you to.

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 1:45 pm
by nveeder
Yes, that is how to get to Contact Management. I thought it would be apparent there was more to the question from the context of this thread.
To summarize: I understand now that if I am using the xi handlers that relate a Nagios XI user to a core contact that settings on the core contact's page such as "Addon Address 1" will not be applied. For a contact to have multiple email addresses, I'll need to specify notification commands other than xi-*-notification-handler. As the notify-host-by-email and notify-service-by-email commands include the text for the notifications as part of the commands, I should expect to create a new command for each custom notification I want to use.
If I've misstated something or if there is a simpler way to go about this, please let me know.

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 2:29 pm
by abrist
nveeder wrote: As the notify-host-by-email and notify-service-by-email commands include the text for the notifications as part of the commands, I should expect to create a new command for each custom notification I want to use.
If I've misstated something or if there is a simpler way to go about this, please let me know.
The notify-*-by-email commands use macros so unless you need some very unique notifications, the standard notify-*-by-email commands should work fine for most alerts. You are correct though, that if you want heavily customized alerts, that it is more cumbersome to do it the core way with the notify-*-by-email commands. You could also copy the XI handlers and edit them to your liking, but it may be a pain to get the second+ email addresses passed to the handle_nagioscore_notification.php script.

Re: Addon Addresses for XI Users

Posted: Thu Mar 28, 2013 2:34 pm
by sreinhardt
As Abrist mentioned, I was going to suggest that you might write a script to take in the variables needed for xi-*-notification handler, and then take your contact and loop through each email address that they have, replacing the email address and otherwise using the notification handler. Might get tricky, however I think it should work for what you need.