Hi.
Is there any way, an API call perhaps, to programmatically delete a service from Core?
We have 90k+ servers (on a bunch of Core servers) and going through the GUI or editing a file as services are deleted is not going to be manageable.
Thanks,
Rick
Programmatically deleting service from Core
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Programmatically deleting service from Core
There isn't a way builtin to do this in Core, however this can be accomplished with the API in Nagios XI
Re: Programmatically deleting service from Core
Fair enough.
If there isn't a built-in way to do it, do you have any suggestions how we can build it (without XI)
If there isn't a built-in way to do it, do you have any suggestions how we can build it (without XI)
Re: Programmatically deleting service from Core
Depends on how long-term of a solution you need.
If you just want a one-off way to delete a lot of specific config files, then proper use of bash or some other programming language should do the trick. grep for a list of host or service names, grab the file name, rm or mv to take it out of the running config, then restart Core.
If you need something reusable, you will want to use a similar workflow, but also expose it on a port to make it an API. That would obviously take more work, but it would be something you could hook into other systems more easily.
If you just want a one-off way to delete a lot of specific config files, then proper use of bash or some other programming language should do the trick. grep for a list of host or service names, grab the file name, rm or mv to take it out of the running config, then restart Core.
If you need something reusable, you will want to use a similar workflow, but also expose it on a port to make it an API. That would obviously take more work, but it would be something you could hook into other systems more easily.
Former Nagios employee