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?
Change alerting contacts on multiple hosts and services
-
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
You could set up host groups and contact groups and assign the contacts to those.
Re: Change alerting contacts on multiple hosts and services
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.
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.
Re: Change alerting contacts on multiple hosts and services
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.
You many need to create a contact as a place holder so none of the contact groups are empty.
Re: Change alerting contacts on multiple hosts and services
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?
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?
Re: Change alerting contacts on multiple hosts and services
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.
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.
Re: Change alerting contacts on multiple hosts and services
Thanks for your help. Can you point me to the Nagios best practices? I can't seem to locate it.
- 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
If your 8 services are identical for all 100 hosts this is relatively easy.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?
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
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.
Re: Change alerting contacts on multiple hosts and services
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.cbuesing wrote:Thanks for your help. Can you point me to the Nagios best practices? I can't seem to locate it.
http://bit.ly/ajxv4R