troubleshooting Question

Delete bulk services using text file, then delete host using text file

Avatar of Harrison Aten
Harrison AtenFlag for United States of America asked on
InstallationRESTScripting Languages
2 Comments1 Solution169 ViewsLast Modified:
I am very new to Rest API. Does anyone know how to create a script that will allow me to create an array of servers called host and delete all services attached to the host. In Nagios XI example cURL request to remove service is:

curl -XDELETE "https://nagiosservername/nagiosxi/api/v1/config/service?apikey=JNKelhL55D47u6GvniX7Y8oOlaQQ2V2LI3YjjZnoCKun6qVsLSS0gAOUJUK2P23N&pretty=1&host_name=testapihost&service_description=PING&applyconfig=1"

What I need to do is delete 700 servers from my Nagios XI install. In order to do that I need to first delete all that is configured for each host including all the services and host groups.
Harrison Aten
Systems Engineer

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros