Page 1 of 1

Host cannot be deleted using this method

Posted: Wed Aug 05, 2020 4:46 pm
by seaward1983
OS - RHEL 7
Nagios XI 5.7.2

Have removed host out of hosts and services. But they remain. I get this when trying to delete them out of the dashboard

Could not find a unique id for this host
Host cannot be deleted using this method

I've seen a LOT of responses on this - but so far nothing has worked

Manually went to /usr/local/nagios/etc/services and /usr/local/nagios/etc/hosts - there are no config files there
Ran this command /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg - no errors or warnings
Went into config file management - delete files, write configs - restart Nagios Core - no errors
Ran this command /usr/local/nagiosxi/scripts/repairmysql.sh nagios - no change
Ran this command mysqlcheck -f -r -u root -p --database nagios - no change

Re: Host cannot be deleted using this method

Posted: Thu Aug 06, 2020 2:52 pm
by jbrunkow
Can you try deleting the Host in the Core Configuration Manager instead of the dashboard?

If a host or service exists in Nagios, it should have a corresponding configuration file in one of the two folders.

Code: Select all

/usr/local/nagios/etc/hosts
/usr/local/nagios/etc/services
Is it possible that this host or service was renamed at some point? It could be that the configuration file is not named what you would expect it to be.

Code: Select all

cat /usr/local/nagios/etc/hosts/* | grep host_name
cat /usr/local/nagios/etc/services/* | grep host_name
It never hurts to send ( PM ) us a profile either! We can find lots of information about your system in there. You can download the profile by navigating to System Profile under System Config on the left pane > and clicking the Download Profile button on that page.

Re: Host cannot be deleted using this method

Posted: Fri Aug 07, 2020 3:19 pm
by seaward1983
We ended up hacking the database. I think we're just going to have to restore from database.

Re: Host cannot be deleted using this method

Posted: Fri Aug 07, 2020 4:09 pm
by jbrunkow
Yes, if you have the skill to do it that way, it is probably the best method.

Thankyou for letting me know. May I lock this thread for editing?

Re: Host cannot be deleted using this method

Posted: Mon Aug 10, 2020 10:52 am
by seaward1983
yes

Re: Host cannot be deleted using this method

Posted: Tue Aug 11, 2020 7:12 am
by scottwilkerson
seaward1983 wrote:yes
Great!

Locking thread