Deleted configs aren't removed from /usr/local/nagios/etc/

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
HDSRetail
Posts: 16
Joined: Fri Oct 28, 2011 1:40 pm
Location: Prag
Contact:

Deleted configs aren't removed from /usr/local/nagios/etc/

Post by HDSRetail »

Hello,

I have issue with "Ghost Hosts". I see, that someone mentioned it here, the FAQ suggest killall nagios && service nagios start, which doesn't help in my situation.

The problem is, that if I remove all hosts from one config file, the database upon writing new configuration doesn't remove the outdated configs. So in my /usr/local/nagios/etc/hosts it looks like:

-rw-rw-r-- 1 apache nagios 1024 Feb 20 10:26 49004 valid_hosts.cfg
-rw-rw-r-- 1 apache nagios 1024 Feb 20 10:26 49004 another_valid_host.cfg
-rw-rw-r-- 1 apache nagios 1013 Feb 19 12:17 49004 already_deleted_host.cfg

Upon start the nagios includes all hosts (ev. services) from this directory and the deleted hosts are still alive. There is no way how to solve it from nagios frontend, which is annoying for our users.

Sincerely

Dan Ohnesorg
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Deleted configs aren't removed from /usr/local/nagios/et

Post by mguthrie »

What version of Nagios XI are you currently running?

The problem is, that if I remove all hosts from one config file, the database upon writing new configuration doesn't remove the outdated configs.
Are you manually editing the config files to make these changes?
HDSRetail
Posts: 16
Joined: Fri Oct 28, 2011 1:40 pm
Location: Prag
Contact:

Re: Deleted configs aren't removed from /usr/local/nagios/et

Post by HDSRetail »

mguthrie wrote:What version of Nagios XI are you currently running?
Currently 2012R1.0, but the problem was in 2011R*.* versions too.
The problem is, that if I remove all hosts from one config file, the database upon writing new configuration doesn't remove the outdated configs.
Are you manually editing the config files to make these changes?
No the configuration is made using GUI. The only manual change is removal of stalled configs. I have seen the issue by more than one instalation.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Deleted configs aren't removed from /usr/local/nagios/et

Post by scottwilkerson »

This was a bug that I believe has been totally eradicated since 2012R1.3 with this fix

http://assets.nagios.com/downloads/nagi ... S-2012.TXT

Code: Select all

- Fixed bug in CCM where renaming config_name for a service could leave behind ghost service configs - MG
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Deleted configs aren't removed from /usr/local/nagios/et

Post by abrist »

We refer to these lost hosts as ghosts. You will have to remove the offending service manually from command line. Log in to the box and cd into the /usr/local/nagios/etc/hosts directory:

This directory contains the cfg files written out by XI when you click "Apply Configuration". Get a listing of the directory and you should find the ghost host. Remove it.

Now, before you "Apply Configuration" in XI or restart the Nagios server, try to "Write Configs to File". You will find this option in the CCM under "Tools" in left hand nav pane. Once they are written, click "Verify". If verification fails, you may have missed a ghost host cfg (that should be removed), or you have other configuration problems. The output from the "Verify" button is in invaluable here.

If "Verify" fails DO NOT restart Nagios or "Apply Configuration". This will revert your configuration to the broken state (and subsequently write the ghost cfg files back to disk) . Instead, look for hints to the offending service or host in the verification output. Once you have fixed any new issues, "Write" and then "Verify" the config once again. You may have to "Write" and then "Verify" multiple times to hunt down all the issues/ghosted files.

Now "Apply Configuration" which will restart nagios if verify was clean of errors..

This is a bug that has been fixed in the version NagiosXI 2012R1.3.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked