Page 1 of 1

deleting host without using GUI and Nagios XI API?

Posted: Mon Aug 24, 2020 1:09 am
by BlakeAntonio
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 ?
VidMate Mobdro word counter

Thanks,

Re: deleting host without using GUI and Nagios XI API?

Posted: Mon Aug 24, 2020 4:33 pm
by gormank
The hosts, services, etc. are stored in a DB which is read and the .cfg files created from that. Thus deleting a .cfg file won't help.
cd /usr/local/nagiosxi/scripts
Have a look at ./nagiosql_delete_host.php --config=service_name
Then run the reconfig to apply.
I'm not sure if this works or if it's wise to use, but it's in my notes from long ago. My notes say run it from the scripts dir.