ghost entries
-
CIBTtechops
- Posts: 13
- Joined: Tue Dec 20, 2011 3:33 pm
ghost entries
Hello,
under 'All service problems' I see many legacy systems (i.e. ones we don't use anymore) are failing service checks (obviously).
But when I go into CCM I don't see any entries for these hosts under Services or Hosts. I therefore cannot delete the hosts.
1) How does this happen? Usually Nagios is good about warning you and not letting you delete a host if it still is associated with any service checks.
2) How can I clean this up and delete these hosts permanently?
Thanks.
under 'All service problems' I see many legacy systems (i.e. ones we don't use anymore) are failing service checks (obviously).
But when I go into CCM I don't see any entries for these hosts under Services or Hosts. I therefore cannot delete the hosts.
1) How does this happen? Usually Nagios is good about warning you and not letting you delete a host if it still is associated with any service checks.
2) How can I clean this up and delete these hosts permanently?
Thanks.
Re: ghost entries
What XI version are you on? This used to be an issue called Ghost Hosts:
https://support.nagios.com/wiki/index.p ... t_Hosts.29
The fix is to delete the configs and re-write them with an Apply Config.
https://support.nagios.com/wiki/index.p ... t_Hosts.29
The fix is to delete the configs and re-write them with an Apply Config.
Former Nagios employee
-
CIBTtechops
- Posts: 13
- Joined: Tue Dec 20, 2011 3:33 pm
Re: ghost entries
Installed Version of Nagios XI: 2012R2.3tmcdonald wrote:What XI version are you on? This used to be an issue called Ghost Hosts:
https://support.nagios.com/wiki/index.p ... t_Hosts.29
The fix is to delete the configs and re-write them with an Apply Config.
does this guidance still apply?
thank you.
Re: ghost entries
Should still apply. Delete the configs then force a re-write by running Apply Configuration.
Former Nagios employee
-
CIBTtechops
- Posts: 13
- Joined: Tue Dec 20, 2011 3:33 pm
Re: ghost entries
I am still a little confused because the solution to the problem description (which is hosts showing up in the status tables but not at all under Hosts or Services) seem to point to multiple instances of Nagios. This is according to the link you sent and it did not recommend deleting anything, rather it suggests that there are multiple instances of Nagios running...tmcdonald wrote:The fix is to delete the configs and re-write them with an Apply Config.
And when you say 'delete the configs' can you please be more specific, if that indeed applies in this case.
Again, to be clear: the Host and Service entries in ccm for this host are completely gone. These hosts are only showing up in the main page under 'all service problems'.
Thanks.
Re: ghost entries
This issue could be caused by multiple instances of nagios running, but it can be also caused by a config that is "left over" (was not deleted). Did you read the "Host Still Visible In XI After Deletion From the CCM " section on our FAQ wiki page?
The fix would be to delete the configs, write, verify and apply configuration.
CCM->Tools->Write Config Files->Delete->Write->Verify->Apply Configuration
Note: If you are using an old version of Nagios XI and you are missing the "Delete" button, you could remove the configs manually:
or move the files to the "/tmp/" directory:
then run the Write Config Tool. The configs (from the database) will be written to flat files.
The fix would be to delete the configs, write, verify and apply configuration.
CCM->Tools->Write Config Files->Delete->Write->Verify->Apply Configuration
Note: If you are using an old version of Nagios XI and you are missing the "Delete" button, you could remove the configs manually:
Code: Select all
rm -rf /usr/local/nagios/etc/hosts/*
rm -rf /usr/local/nagios/etc/services/*Code: Select all
mkdir /tmp/hosts /tmp/services
mv /usr/local/nagios/etc/hosts/* /tmp/hosts/
mv /usr/local/nagios/etc/services/* /tmp/services/Be sure to check out our Knowledgebase for helpful articles and solutions!
-
CIBTtechops
- Posts: 13
- Joined: Tue Dec 20, 2011 3:33 pm
Re: ghost entries
[quote="lmiltchev"]This issue could be caused by multiple instances of nagios running, but it can be also caused by a config that is "left over" (was not deleted). Did you read the "Host Still Visible In XI After Deletion From the CCM " section on our FAQ wiki page?
would that not delete all config files in those directories? I am only having issues with a couple of them...
hmmm.
Code: Select all
rm -rf /usr/local/nagios/etc/hosts/*
rm -rf /usr/local/nagios/etc/services/*hmmm.
-
CIBTtechops
- Posts: 13
- Joined: Tue Dec 20, 2011 3:33 pm
Re: ghost entries
I tried deleting the 'ghost' entry in /usr/local/nagios/etc/hosts as described - it turns out it still does have an entry there.
Then I tried to restart Nagios and got this error:
Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration.
Then I put the .cfg file for the host in question back the way it was, and then Nagios started.
[root@colnagios hosts]# /etc/init.d/nagios start
Starting nagios: done.
So all is running, but that ghost host is of course still there.
..so much for the FAQ.
Then I tried to restart Nagios and got this error:
Starting nagios:CONFIG ERROR! Start aborted. Check your Nagios configuration.
Then I put the .cfg file for the host in question back the way it was, and then Nagios started.
[root@colnagios hosts]# /etc/init.d/nagios start
Starting nagios: done.
So all is running, but that ghost host is of course still there.
..so much for the FAQ.
-
CIBTtechops
- Posts: 13
- Joined: Tue Dec 20, 2011 3:33 pm
Re: ghost entries
I guess that is what you are saying.CIBTtechops wrote:lmiltchev wrote:This issue could be caused by multiple instances of nagios running, but it can be also caused by a config that is "left over" (was not deleted). Did you read the "Host Still Visible In XI After Deletion From the CCM " section on our FAQ wiki page?
would that not delete all config files in those directories? I am only having issues with a couple of them...Code: Select all
rm -rf /usr/local/nagios/etc/hosts/* rm -rf /usr/local/nagios/etc/services/*
hmmm.
So we actually should delete ALL entries in Hosts and Services? Then do a apply config to repopulate.
Sorry, when you are recommending rm -rf * I needed to ask twice to be sure!
Re: ghost entries
Deleting just the host likely resulted in some services (or other objects) sticking around that relied on that host being present, hence the error. This is why we say in the FAQ to delete all the entries in both .../hosts/ and .../services/ directories. Deleting all of the configs and then re-writing with Apply Config usually solves this. If you are reluctant to do the rm -rf * as the FAQ suggested, you can instead back the files up to /tmp or somewhere else instead.
Former Nagios employee