Add contact group to host group
- snapon_admin
- Posts: 952
- Joined: Mon Jun 10, 2013 10:39 am
- Location: Kenosha, WI
- Contact:
Add contact group to host group
I'm trying to find the easiest way to do this based on my current setup and figured I'd post here while I'm doing my own digging and see if you guys had any suggestions. I have host groups setup for all of our different locations that include all of the hosts for those locations. I also have contact groups for each location. Currently, users are being added as needed and when a new user gets added, they get put into the appropriate contact group for wherever they're located. I can't seem to find a quick easy way of adding an entire contact group to an entire hostgroup. What I currently have to do is search in CCM for any hosts in a given location and go in and add the appropriate contact group to each host individually. It's not terribly difficult, but it could be made easier. I love using the bulk modifications tool for changes similar to this, but there's no "hostgroup" option when you select "add a contact group". Any help would be appreciated.
Re: Add contact group to host group
Do you use templates at all? I assign templates to hosts that supply check settings and contacts(or groups) that are appropriate. If you need more detail, just say so, just in the middle of something right now.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
- snapon_admin
- Posts: 952
- Joined: Mon Jun 10, 2013 10:39 am
- Location: Kenosha, WI
- Contact:
Re: Add contact group to host group
Not really. I haven't experimented with templates yet, though I do see that this has been done using templates before. I just have no idea how to use them. I'm looking into some of the template documentation as we speak.
Edit: Oh wow, this looks easier than I thought. Just to make sure I'm headed in the right direction, would this be the right way to go about this?
Using Chicago, IL as an example:
Create template called 'contacts_chicago'
Create contact group called Chicago Admins and add appropriate contacts
Create host group called Chicago Hosts and add appropriate hosts
Add Chicago Admins contact group and Chicago hosts to contacts_chicago template
Is that basically it? If I leave check settings, flapping settings, etc. all blank will that effect the hosts negatively? Also, if the host has different contact groups already assigned to it, will adding this template overwrite that or simply add the additional contact group?
Edit: Oh wow, this looks easier than I thought. Just to make sure I'm headed in the right direction, would this be the right way to go about this?
Using Chicago, IL as an example:
Create template called 'contacts_chicago'
Create contact group called Chicago Admins and add appropriate contacts
Create host group called Chicago Hosts and add appropriate hosts
Add Chicago Admins contact group and Chicago hosts to contacts_chicago template
Is that basically it? If I leave check settings, flapping settings, etc. all blank will that effect the hosts negatively? Also, if the host has different contact groups already assigned to it, will adding this template overwrite that or simply add the additional contact group?
Re: Add contact group to host group
You can create a host template, add the "Chicago Admins" contact group to it, and then apply this template to all of your "Chicago Hosts".
http://nagios.sourceforge.net/docs/nagi ... tance.html
No, these settings will be pulled from the template (if set). All of the local settings (on a host/service level) will take precedence (override the template).If I leave check settings, flapping settings, etc. all blank will that effect the hosts negatively?
If you added an additional contact group to your host, this would override the template. If you want to use both contact groups (from the template, and from the host definition), you can use the "+" button under the Host Template Management (additive inheritance). Read about it here:Also, if the host has different contact groups already assigned to it, will adding this template overwrite that or simply add the additional contact group?
http://nagios.sourceforge.net/docs/nagi ... tance.html
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Add contact group to host group
NO!snapon_admin wrote:Using Chicago, IL as an example:
Create template called 'contacts_chicago'
Create contact group called Chicago Admins and add appropriate contacts
Create host group called Chicago Hosts and add appropriate hosts
Add Chicago Admins contact group and Chicago hosts to contacts_chicago template
The hostgroup you add to the template is telling any host you add the template to should belong to that template, not the way you describe. Trust me, I SOOOOOO wish it worked that way!
If all you are doing is just contacts and don't want to do templates for any other settings, why not just use the contact_group itself and add it to all the hosts? Then all you have to do is modify the contact_group whenever someone new comes along. You can use the bulk modifications tool to add the contact group to multiple hosts at once. I think it is an enterprise feature, but if you have never enabled the enterprise demo, you can enable it and have the features for 30 or 60 days(can't recall) and that should be plenty of time for you to do all the changes you want.
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
See my projects on the Exchange at BanditBBS - Also check out my Nagios stuff on my personal page at Bandit's Home and at github
Re: Add contact group to host group
I am pretty sure all of our trials are 60 days.BanditBBS wrote:I think it is an enterprise feature, but if you have never enabled the enterprise demo, you can enable it and have the features for 30 or 60 days(can't recall) and that should be plenty of time for you to do all the changes you want.
@snapon: I agree with Bandit here. One-to-one and one-to-many relations are easy to set up, but many-to-many are a bit harder. Just takes some logic and organization.
Former Nagios employee
- snapon_admin
- Posts: 952
- Joined: Mon Jun 10, 2013 10:39 am
- Location: Kenosha, WI
- Contact:
Re: Add contact group to host group
The only reason I don't normally do this is to avoid missing something. In CCM I can search for 'Chicago' and, since all of our Chicago hosts have the city in the description, it will find all of them. Not all of our hosts have the city name (in fact most don't) in the name of the host, so sifting through ~1000 hosts to make sure I got all of them is a pain. That was why I wanted to try the hostgroup method. I can try this out and see how that goes. For hosts it shouldn't be a problem, services are a whole different matter. If I need to add a contact group to specific services that can be a hassle since I have to sift through 17,000 services. I'll do some playing in test and see if there's a more efficient way of doing this. Thanks for the tips.
Re: Add contact group to host group
Let us know how it went. I will leave the topic unlocked.
Be sure to check out our Knowledgebase for helpful articles and solutions!