deleting host without using GUI and Nagios XI API?

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
BlakeAntonio
Posts: 2
Joined: Mon Aug 24, 2020 1:06 am

deleting host without using GUI and Nagios XI API?

Post 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,
Last edited by BlakeAntonio on Wed Aug 26, 2020 3:58 am, edited 1 time in total.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

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

Post 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.
Locked