Nagios XI - Host Still Visible After Deletion (Ghost Hosts)
Host Still Visible After Deletion (Ghost Hosts)
You have successfully deleted a host and all of it's services from the Core Config Manager, but you are still seeing it the web UI.
It is possible that you have multiple instances of nagios running or you have so called "ghost" hosts or services.
In order to check for multiple instances of nagios, run the following command from the command line:
ps -ef | head -1 && ps -ef | grep bin/nagios
You will see something like this:
UID PID PPID C STIME TTY TIME CMD
In the example above, there are no multiple instances of nagios running as there is only one "main" process with PID=3828 and the rest of them are "child" processes that spun from this "parent" (PPID=3828).
If there are no multiple instances of nagios running on the Nagios XI server it is possible that you have "ghost" hosts or services. Ghosts are caused by a config file that for some reason is "left behind" after deleting the host and its services in the Core Config Manager.
Note: This problem was more common with some of the older versions of Nagios XI. The issue is rarely seen in the newer version of XI, so if you are running an old version of Nagios XI (prior to 2014x), it would be a good idea to upgrade to the latest.
In order to resolve the issue with the multiple instances of nagios, run the following commands in the command line:
RHEL 7 | CentOS 7 | Oracle Linux 7 | Debian | Ubuntu 16/18
systemctl stop nagios.service
In case you have a "ghost" issue, go to the Core Config Manager > Tools > Config File Management, use the Write Configs button to manually write out the configuration data to file. Then use the Verify Files button to test configuration. If it verifies, go ahead and restart Nagios.
If by chance the host and all of it's services are completely deleted in the Core Config Manager, and the actual host config file is still there after using the Write Configs button, then go ahead and delete the config file manually. The files will be located in the following directories:
Example: to delete a "ghost" host, go to the "hosts" directory:
Run the following command to view the configs sorted by modification time (the oldest files will be on the bottom):
Hint: If you notice a configuration file with an old timestamp (file that is not being updated), it is possible this is a "ghost" host. To remove the config file run:
rm -f <ghost config>
Another, much easier way to resolve "ghost" host/services issues is to delete all host/service configuration files and then apply configuration.
For any support related questions please visit the Nagios Support Forums at:
|Posted by: lmiltchev - Tue, Jan 27, 2015 at 1:05 PM. This article has been viewed 6602 times.|
|Online URL: https://support.nagios.com/kb/article/nagios-xi-host-still-visible-after-deletion-ghost-hosts-27.html|
Powered by PHPKB (Knowledge Base Software)