Delete HostGroups via API

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Delete HostGroups via API

Post 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!
Last edited by nagwindmon on Fri Jun 02, 2017 10:35 am, edited 1 time in total.
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Delete HostGroups via API

Post 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.
Previous Nagios employee
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Re: Delete HostGroups via API

Post 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...
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Delete HostGroups via API

Post by avandemore »

You can select more than one to delete.
Previous Nagios employee
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Re: Delete HostGroups via API

Post by nagwindmon »

so there is no API call exist I can use to delete HostGroups??
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Delete HostGroups via API

Post 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.
Previous Nagios employee
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Re: Delete HostGroups via API

Post 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?
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Delete HostGroups via API

Post 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
nagwindmon
Posts: 92
Joined: Mon Dec 01, 2014 3:39 pm

Q

Post by nagwindmon »

yes, we're Enterprise customers, so let me check that option out
Thanks!
dwhitfield
Former Nagios Staff
Posts: 4583
Joined: Wed Sep 21, 2016 10:29 am
Location: NoLo, Minneapolis, MN
Contact:

Re: Delete HostGroups via API

Post by dwhitfield »

OK, let us know!
Locked