Bulk Modifications for Contacts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Bulk Modifications for Contacts

Post by jkinning »

I have several, hundreds, of Contacts that don't have the host|service_notifications_enabled set to 1 (on). Is there a way within the UI to change all the Contacts to have the Host and Services notifications to enabled?

Maybe I am not understanding this but if I have a Host and/or Services checks and have a specific contact(s) assigned either individually or within a Contact Group will they still receive the notifications or does this setting need set?
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Bulk Modifications for Contacts

Post by lmiltchev »

I have several, hundreds, of Contacts that don't have the host|service_notifications_enabled set to 1 (on).
How did you create these contacts? Did you create them by going to "CCM->Contacts->Add New" or by going to "Admin->Manage Users->Add New User"?

If you are having issues with notifications, I would recommend sending your profile to [email protected].

Admin->System Profile->Download Profile

This way we can review all of your configs.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Bulk Modifications for Contacts

Post by jkinning »

I used CCM->Contacts->Add New and then created config files and placed them into the Import directory.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Bulk Modifications for Contacts

Post by lmiltchev »

Do you have a template assigned to these contacts? If you do, you could enable notifications in the template these contacts are using.
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Bulk Modifications for Contacts

Post by jkinning »

No, because I never quite understood how they work. If I use a contact template does that override the other settings or do I just forget about setting the other settings on the contact and the template manages those. Setting I am referring to the host and service_notification_commands and periods.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Bulk Modifications for Contacts

Post by ssax »

You set the settings in the template so you don't have to define them on the contact, if it's defined on the contact it will override the template. Locally defined things always override the templates.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Bulk Modifications for Contacts

Post by lmiltchev »

A template won't override settings on a host/service level. It is the other way around. "Local" object variables always take precedence over variables defined in the template object. For more information on the topic, please review the document below:

https://assets.nagios.com/downloads/nag ... tance.html

You can set up a contact template with host/service notifications enabled:

Code: Select all

host_notifications_enabled    		1
service_notifications_enabled 		1
Copy the "/usr/local/nagios/etc/contacts.cfg" file to the "/usr/local/nagios/etc/import/" directory. Modify the file by adding the template to your contacts, save, exit, and run reconfigure_nagios.sh.

Code: Select all

cd /usr/local/nagiosxi/scripts
./reconfigure_nagios.sh
As always, it's is a good idea to create backups/snapshots, etc. prior to making big changes. :)
Be sure to check out our Knowledgebase for helpful articles and solutions!
jkinning
Posts: 747
Joined: Wed Oct 09, 2013 2:54 pm

Re: Bulk Modifications for Contacts

Post by jkinning »

Thanks for the template idea and link.

I ended up deleting all the contacts I had and then created new cfg files with the use <template> and tossed them in the import directory. Clicked Applied Configuration and they are all there using the template. Brilliant!

Close at your convenience.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Bulk Modifications for Contacts

Post by lmiltchev »

I am glad I could help! I am locking this thread.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked