Add contact group to multiple hosts at once

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
lane777smith
Posts: 2
Joined: Fri Apr 27, 2012 10:24 am

Add contact group to multiple hosts at once

Post by lane777smith »

I'm running Nagios XI. Is there a way to add a Contact Group to the Notification Setting on multiple Host and Service checks at the same time? I need to add a group to about 30 different checks and having to manual edit each check is a bit unwanted. :D
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Add contact group to multiple hosts at once

Post by jbennett »

I'm interested in this, but in reverse. I need to change the contact group that is assigned to a number of hosts and services on a total of about 4000 items.

Please tell us that there is an option for bulk updating contact groups! I would think it would be similar to the bulk contact update wizard in the CCM beta...??
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Add contact group to multiple hosts at once

Post by mguthrie »

I can put the bulk modification for contact groups on the TODO list for the new CCM, but my guess would be that it'll be a little bit before I could have that ready since I've got a few other projects I need to finish first.

For the contact group remove for about 4000 items, you could run an SQL query (at your own risk) and just blanket remove all service -> contactgroup relationships.

Code: Select all

mysql -pnagiosxi nagiosql
DELETE FROM tbl_lnkServiceToContactgroup;
This will clear ALL service->contactgroup relationships, but it will leave template relationships intact. Let me restate, do this AT YOUR OWN RISK ;)

This can work for hosts as well if needed.

Code: Select all

DELETE FROM tbl_lnkHostToContactgroup;
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Add contact group to multiple hosts at once

Post by mguthrie »

@lane777smith, this feature is built in to the new CCM that is currently in beta. I can send you the link if you're interested in trying it out. Otherwise, the other way to manage this is with the use of templates, and as far as maintenance goes, that's probably the best long-term solution.
lane777smith
Posts: 2
Joined: Fri Apr 27, 2012 10:24 am

Re: Add contact group to multiple hosts at once

Post by lane777smith »

mguthrie, A link would be great. I'll look into the templates as well. Thanks.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Add contact group to multiple hosts at once

Post by scottwilkerson »

Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked