Delete host using REST API error on XI version 5.5.11

This board serves as an open discussion and support collaboration point for Nagios XI. NOTE: Nagios XI customers should use the Customer Support forum to obtain expedited support.

Delete host using REST API error on XI version 5.5.11

Postby JosephH » Tue Jun 18, 2019 7:08 am

I am using Nagios XI 5.5.11 Rest API to delete a host and get this error: {"error":"Host cannot be deleted using this method. Must be deleted through the CCM."}. I also make sure to delete all the services of this host before delete itself. Based on one of the search result viewtopic.php?f=16&t=42680, I added the sleep for 10 second, looks like it works for sometime, but not all the time. Any help is greatly appreciated.
JosephH
 
Posts: 18
Joined: Fri Oct 12, 2018 10:04 am

Re: Delete host using REST API error on XI version 5.5.11

Postby benjaminsmith » Tue Jun 18, 2019 11:56 am

Hi Joseph,

This host might have existing dependent relationships. Can you verify this by going to the Configure > CCM > Monitoring > Hosts and search for the host from the box in the upper right. In the listing, under the actions heading, click on the icon for relationships.

If that is not the issue, can you post the API command for us to review. Thanks
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!
User avatar
benjaminsmith
 
Posts: 1716
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Delete host using REST API error on XI version 5.5.11

Postby JosephH » Tue Jun 18, 2019 1:32 pm

hi benjaminsmith,

Thank you for the quick response. I followed your direction for this host, and the only thing for this host listed on the object relationships is contacts - somename. Nothing else.

the command I used like this:
https://nagiosxiserver/nagiosxi/api/v1/ ... st&force=1
after that, I ran applyconfig=1.
https://nagiosxiserver/nagiosxi/api/v1/ ... y=myapikey

Let me know if more info needed.

Thank you,
Joseph
JosephH
 
Posts: 18
Joined: Fri Oct 12, 2018 10:04 am

Re: Delete host using REST API error on XI version 5.5.11

Postby benjaminsmith » Wed Jun 19, 2019 12:54 pm

Hi Joseph,

I rolled back my text VM to this version and was able to repeat the error you getting. However, on the lastet version it is working with the following command.

curl -XDELETE "http://<ip address>/nagiosxi/api/v1/config/host/testapihost?apikey=<api key>&pretty=1&host_name=testhost&applyconfig=1"

Are you able to upgrade to the latest version?
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!
User avatar
benjaminsmith
 
Posts: 1716
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Delete host using REST API error on XI version 5.5.11

Postby JosephH » Wed Jul 24, 2019 12:41 pm

upgrade to 5.6.5 and worked.
JosephH
 
Posts: 18
Joined: Fri Oct 12, 2018 10:04 am

Re: Delete host using REST API error on XI version 5.5.11

Postby mbellerue » Wed Jul 24, 2019 1:26 pm

Glad to hear it's working now!
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!
User avatar
mbellerue
 
Posts: 646
Joined: Fri Jul 12, 2019 11:10 am


Return to Nagios XI

Who is online

Users browsing this forum: benjaminsmith and 12 guests