Change alerting contacts on multiple hosts and services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
cbuesing
Posts: 7
Joined: Thu Apr 08, 2010 11:20 am

Change alerting contacts on multiple hosts and services

Post by cbuesing »

I have about 100 host with about 8 services per host. They are currently setup to send notifications to one contact. I would like to add a contact group to all of these but I don't see a way to do this without editing each host and service individually. This would take a VERY long time to do.

Is there way to edit the alerting contacts on multiple hosts and services at one time?

Or is there a way to change the hosts alerting contacts and have the services inherit the settings from the host?
tonyyarusso
Posts: 1128
Joined: Wed Mar 03, 2010 12:38 pm
Location: St. Paul, MN, USA
Contact:

Re: Change alerting contacts on multiple hosts and services

Post by tonyyarusso »

You could set up host groups and contact groups and assign the contacts to those.
Tony Yarusso
Technical Services
___
TIES
Web: http://ties.k12.mn.us/
cbuesing
Posts: 7
Joined: Thu Apr 08, 2010 11:20 am

Re: Change alerting contacts on multiple hosts and services

Post by cbuesing »

Ok, I do have host groups and contact groups. I can assign a contact to a contact group no problem.

How do you assign a contact group to a host group? I can assign it to the host but I don't see a way to assign it to the entire group.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Change alerting contacts on multiple hosts and services

Post by mmestnik »

Ignore the host groups for this task. Make a contact group for each group of services/hosts you'd want to assign contacts to.

You many need to create a contact as a place holder so none of the contact groups are empty.
cbuesing
Posts: 7
Joined: Thu Apr 08, 2010 11:20 am

Re: Change alerting contacts on multiple hosts and services

Post by cbuesing »

I know now that when I setup my 100 hosts and 8 services per host, I should have used contact groups instead of a contact.

My problem is that I want to be able to add a contact group to the 100 hosts and 800 services, that I already have created, without having to edit each one individually (900 total).

Is there a way to do this?
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Change alerting contacts on multiple hosts and services

Post by mmestnik »

It's as you suspect.

I would imagine if you wanted to avoid any other potholes that you could read up on Nagios best practice. There should be about ten years worth of experience to draw from in the form of howtos and other articles.
cbuesing
Posts: 7
Joined: Thu Apr 08, 2010 11:20 am

Re: Change alerting contacts on multiple hosts and services

Post by cbuesing »

Thanks for your help. Can you point me to the Nagios best practices? I can't seem to locate it.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Change alerting contacts on multiple hosts and services

Post by Box293 »

cbuesing wrote:I know now that when I setup my 100 hosts and 8 services per host, I should have used contact groups instead of a contact.

My problem is that I want to be able to add a contact group to the 100 hosts and 800 services, that I already have created, without having to edit each one individually (900 total).

Is there a way to do this?
If your 8 services are identical for all 100 hosts this is relatively easy.

I.E. for ping
Create a host group for the ping service
Add the 100 hosts to the group
Apply Configuration
Edit one of the existing ping services
Change the "host groups" membership to include your ping group
Change the "hosts" membership so it has no members
Change the "config name" to be ping
Change the Contact group stuff
Save
Apply Configuration
Repeat these step for the 7 other service checks
Once you have the 8 services assigned to host groups delete all the services in bulk. In the end you would be left with 8 services (plus localhost services etc)
Apply Configuration

Now you should have the same as before. This is much quicker than editing all 800 services :lol:

Here is a more detailed explanation http://support.nagios.com/forum/viewtopic.php?f=9&t=326

Changing the hosts themselves might be time consuming. Consider the using the XI Config Import prep tool to re-import your hosts with your desired contact group settings. Do this first for 99 of the hosts and then manually change the remaining one last, this isone way to delete all the services in bulk and just leave the 8 you want assigned to 1 host.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Change alerting contacts on multiple hosts and services

Post by mmestnik »

cbuesing wrote:Thanks for your help. Can you point me to the Nagios best practices? I can't seem to locate it.
As indicated the Internet is abound with these types of reference materials. I don't have any favorites, but I'd say read a handful and you should be able to spot any bad advice by cross referencing them.

http://bit.ly/ajxv4R
Locked