Page 1 of 1

Delete HostGroups via API

Posted: Fri Jun 02, 2017 9:44 am
by nagwindmon
Nagios team,
I'm inheriting NagiosXI environment where I found there are quite a few orphans HostGroup I would like to get rid of.


Please advise!

Re: Delete HostGroups via API

Posted: Fri Jun 02, 2017 9:52 am
by avandemore
The easiest way to handle is to delete it via the CCM:
XI > Configure > CCM > Host Groups

You can view the relationships to see if some dependencies are blocking the deleting.

Re: Delete HostGroups via API

Posted: Fri Jun 02, 2017 10:06 am
by nagwindmon
I would not say easiest... there are over 100s and not listed in any order so I need search for each one and delete individually??
I have pulled a list of those from DB into csv file and was hoping I could loop thru utilizing API...

Re: Delete HostGroups via API

Posted: Fri Jun 02, 2017 10:08 am
by avandemore
You can select more than one to delete.

Re: Delete HostGroups via API

Posted: Fri Jun 02, 2017 10:13 am
by nagwindmon
so there is no API call exist I can use to delete HostGroups??

Re: Delete HostGroups via API

Posted: Fri Jun 02, 2017 10:20 am
by avandemore
The existing API calls for your installed version can be found at XI > Help > REST API Docs. In some cases the API is unreliable.

Re: Delete HostGroups via API

Posted: Fri Jun 02, 2017 10:27 am
by nagwindmon
ok, let me ask you this: is there an API to delete a hostgoups and if yes in which XI version its available from?

Re: Delete HostGroups via API

Posted: Fri Jun 02, 2017 11:02 am
by dwhitfield
Currently, you cannot delete host groups via the API. You could delete things directly from the database, but we generally discourage this.

The Bulk Modifications Tool is technically part of the CCM, but it is only available to Enterprise customers. See http://YOURSERVER/nagiosxi/includes/com ... /index.php

Q

Posted: Fri Jun 02, 2017 1:50 pm
by nagwindmon
yes, we're Enterprise customers, so let me check that option out
Thanks!

Re: Delete HostGroups via API

Posted: Fri Jun 02, 2017 1:53 pm
by dwhitfield
OK, let us know!