Hi,
As part of my project, i need to delete hosts without using nagios XI GUI and API.
so I have deleted a existing host (host1.cfg) config file from /usr/local/nagios/etc/hosts/host1.cfg
But same host is re-created when i run $/usr/local/nagiosxi/scripts/reconfigure_nagios.sh
Please help on
a) why reconfigure_nagios.sh script re-creating deleted host ? or
b) How can i delete host without using GUI and APIs ?
Thanks,
Bhaskar
deleting host without using GUI and Nagios XI API
-
- Posts: 5
- Joined: Fri May 29, 2020 9:55 am
Re: delete host without using GUI and API
You should not manually delete/modify files under /usr/local/nagios/etc/hosts or /usr/local/nagios/etc/services (unless it's in /usr/local/nagios/etc/static) as it will interfere with the functionality of the system.
The CCM is the database, when you apply configuration the CCM writes out the changes from the DB to the filesystem and then restart the nagios service to pick up those changes to make them active.
All an apply config does is this:
Which is writing out the changes to disk (which is why your host being recreated).
You will need to use the API or delete them from the CCM manually so that the relationships can be handled properly (so you don't have an invalid config), otherwise you can define them in /usr/local/nagios/etc/static if you want to manually manage the configs (but you won't be able to see them in the CCM to modify them).
The CCM is the database, when you apply configuration the CCM writes out the changes from the DB to the filesystem and then restart the nagios service to pick up those changes to make them active.
All an apply config does is this:
Code: Select all
cd /usr/local/nagiosxi/scripts && ./reconfigure_nagios.sh
You will need to use the API or delete them from the CCM manually so that the relationships can be handled properly (so you don't have an invalid config), otherwise you can define them in /usr/local/nagios/etc/static if you want to manually manage the configs (but you won't be able to see them in the CCM to modify them).
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 5
- Joined: Fri May 29, 2020 9:55 am
Re: deleting host without using GUI and Nagios XI API
Thank you Jbrukow for the response and suggestions.
Please close this.
Thanks
Please close this.
Thanks
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: deleting host without using GUI and Nagios XI API
Great!breddymd0034 wrote:Thank you Jbrukow for the response and suggestions.
Please close this.
Thanks
Locking thread