Replace hostgroup on 100's of hosts

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ottow
Posts: 44
Joined: Wed Nov 15, 2017 3:45 am

Replace hostgroup on 100's of hosts

Post by ottow »

Hi,

We are expanding our deployment of mod_gearman workers and need to switch several 100s of hosts to a new worker.
To do this, we need to remove a mg_objects_ hostgroup currently set on each host (not inherited) and add a new, different mg_objects hostgroup.

What would be the easiest way to do this?
We've looked at using the Bulk Modifications Tool, but it is really cumbersome to remove a hostgroup from large numbers of individual hosts using it....

Is there a better solution?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Replace hostgroup on 100's of hosts

Post by benjaminsmith »

Hi @ottow,

The other solution would be to script this out using the API, see the PUT config/hostgroup/<hostgroup_name> endpoint. If this something you commonly do, then it makes sense to take a little more time to do this programitcally. One caveat, that endpoint will overwrite the entire host group, you cannot append a single member to the hostgroup using the PUT option.

Otherwise, the Remove Host Group in the Bulk Mods Tool is probably the best choice.

Regards,
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
ottow
Posts: 44
Joined: Wed Nov 15, 2017 3:45 am

Re: Replace hostgroup on 100's of hosts

Post by ottow »

I see. Thanks.
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Replace hostgroup on 100's of hosts

Post by benjaminsmith »

Hi Ottow,

Let's know if you have any other questions or if it's okay to close this topic.

Best Regards
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked