Host still showing up under service status

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mmestnik
Posts: 972
Joined: Mon Feb 15, 2010 2:23 pm

Re: Host still showing up under service status

Post by mmestnik »

When you performed the steps

Code: Select all

killall nagios
service nagios start
Did you look first or did you just run the commands as is?


Here are some useful tools for process management and debugging on UNIX systems.

Code: Select all

yum -y install gdb; # Install the debugger.
pstree -p > nagiostree.txt;
for ech in $(pgrep nagios); do gcore -o ${ech}-core.bin -p $ech; done;
Then I'll need all the *-core.bin files and a copy of your nagios executable, I think it's in /usr/local/nagios/bin. The These files are sensitive so they can be emailed like previously. nagiostree.txt should not be too sensitive and you can get that to us any way you want.

This would relay only be helpful if there is more then one parent nagios process running, as I still suspect.

One way to try and stop nagios is

Code: Select all

killall -9 nagios
pstree can should parent nagios processes, but here is an easy way to list what's running and list nagios

Code: Select all

ps ax;
ps l $(pgrep nagios);
To start Nagios I recommend only using the web interface, we wrote that to start Nagios in the most effective way possible and it's use if nothing else should reduce typos.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Host still showing up under service status

Post by mguthrie »

I looked through the configuration files, not seeing anything that stands out at the moment. Is the host that you deleted in the CCM showing up in the config files after you have deleted it and used the Write Config Tool?

The way Nagios XI's Core Config Manager saves your changes to the mysql database when you make a change in it, and then when you're ready for it to be permanent it write's the DB info to the config files. If there's an error, it will roll back to the last known good configuration. So let me ask a couple of clarifying questions to make sure I'm understanding your situation correctly:

You've deleted a host and all of it's corresponding services. After deleting it, were you able to Apply Configuration in the Core Config Manager without any errors? If you did receive errors, check the text file on the Configuration Snapshots page to see what it was that generated the error.

After using the Write Config Tool, are you seeing the host in your configuration files?

Is any of this host information located in the static directory? In which case it won't be managed the same by XI.
lntyee
Posts: 36
Joined: Thu Apr 22, 2010 3:03 pm

Re: Host still showing up under service status

Post by lntyee »

Hi -

"You've deleted a host and all of it's corresponding services. After deleting it, were you able to Apply Configuration in the Core Config Manager without any errors? If you did receive errors, check the text file on the Configuration Snapshots page to see what it was that generated the error."

*Yes - I was able to apply the configuration without any errors.

"After using the Write Config Tool, are you seeing the host in your configuration files? "

* No - If I run the "check configuration files" option, the host in question is NOT listed.

"Is any of this host information located in the static directory? In which case it won't be managed the same by XI."

* I'm not sure what you mean by that. How would I check a static directory?

Thanks.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Host still showing up under service status

Post by mguthrie »

I checked your static directory from your config snapshot, and there didn't appear to be any host data in it. Some I'm pretty sure that's not the issue.

/usr/local/nagios/etc/hosts #contains config files for hosts.
/usr/local/nagios/etc/services #contains config files for services

You may want to check to see if the host configs are still in those directories, as well as verify that the host hasn't reappeared in the CCM.

We'll do some more looking into what might cause this. The only other time we've seen "ghost hosts" is when there are multiple instances of Nagios running, and either restarting the server or killing all nagios instances and starting it from the web UI were the fixes for it. We'll let you know as soon as we have something more...
lntyee
Posts: 36
Joined: Thu Apr 22, 2010 3:03 pm

Re: Host still showing up under service status

Post by lntyee »

Ah ha! There was a cfg file in the /etc/services directory for that host. I knew about the /etc/hosts directory, but not the services directory. Once I deleted that .cfg file, the problem went away. Thanks so much for all the help!
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Host still showing up under service status

Post by mguthrie »

Good deal! In a normal situation you wouldn't want to mess with anything in the /etc directory, but it sounds like this was cleared out of the DB ok but there must have been an error or issue deleting the actual cfg file.
sal@coned
Posts: 72
Joined: Thu Jan 21, 2010 4:42 pm

Re: Host still showing up under service status

Post by sal@coned »

Was this issue resolved? I have the same problem, after removing a host it still shows up in the alerts.

I performed a write config command and see that the host is still listed in the config files generated, but when I go through the config gui the host does not show up.

How can I delete the host when I cannot see it ?

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

Re: Host still showing up under service status

Post by mguthrie »

I posted on your new thread, this might be a different issue. My guess is that you might have multiple instances of Nagios running. Better to continue this discussion on one thread though:
http://support.nagios.com/forum/viewtop ... =16&t=1057
Locked