Page 1 of 1

Adding/removing services via Nagios API

Posted: Wed Mar 14, 2018 7:40 pm
by haile711
To support,

I have couple nagios servers, and I have all the configuration setup under the "static" directory for easier to manage through automation. I was wondering if we can use the Nagios API to add/remove services under the static directory?

youtube tutorial from Nagios XI

https://www.youtube.com/watch?v=iXbSmaZ0PRE

Thank you very much for checking.

Re: Adding/removing services via Nagios API

Posted: Thu Mar 15, 2018 9:54 am
by lmiltchev
No, you cannot use the REST API to add/remove hosts/services that reside in the static directory. These configs are not present in the database. That's why they are handled manually. If you want to add/remove hosts/services in the static, you would need to add/modify the configs (e.g. via a script), and restart nagios.