Bulk add servicegroup

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Bulk add servicegroup

Post by BanditBBS »

Forgive me if thread already exists, I'm sure at least one does, just wasn't having luck finding it!

Is there a reason bulk mod tool only allows adding hostgroup but doesn't offer adding servicegroup in bulk? I have a servicegroup I need to add to many services and can't think of an easy way to do it. I can't add then on the sg, I need to add on the service definition.
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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Bulk add servicegroup

Post by ssax »

Bandit, how goes it brother?

Yep, you're correct, I'll double-check on the FR, I'll let you know shortly on an alternative.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Bulk add servicegroup

Post by ssax »

Here's the FR:
FR: XI - Bulk Mods Tool - Add Add Service Groups/Remove Service Groups (Just like hostgroups)
Actually, I need to know the exact XI version of the one you're working on.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Bulk add servicegroup

Post by BanditBBS »

Don't laugh, 5.4.12. I need to get it upgraded!
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
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

Re: Bulk add servicegroup

Post by ssax »

This will only work on 5.4.12 and likely 5.4.13, I wouldn't bother trying it on XI 5.5+

First, take an XI backup (and/or) make sure you can apply config successfully first so it creates a config snapshot that you can revert to if necessary.


Take the attached component, unzip it, and replace these files (make backups of your current ones first):

Code: Select all

/usr/local/nagiosxi/html/includes/components/bulkmodifications/bulkmodifications.inc.php
/usr/local/nagiosxi/html/includes/components/bulkmodifications/step2.php
/usr/local/nagiosxi/html/includes/components/bulkmodifications/includes/bulkmods.js
Then because the index.php file is encrypted you will not be able to see it in the web interface, call it like this directly in the address bar of your browser:

Code: Select all

https://YOURXISERVER/nagiosxi/includes/components/bulkmodifications/step2.php?cmd=addservicegroups
NOTE: Remove servicegroups does not work, don't try it, I couldn't get it to work quick enough (aka, revert to CCM snap if you add it to the wrong ones or make a mistake)

That should do it, let me know the results.
You do not have the required permissions to view the files attached to this post.
Locked