Page 1 of 2

Ghost Host in Nagios XI 2012R1.2

Posted: Mon Dec 10, 2012 11:20 am
by zahdin
Hi,

I have imported the Nagios VM in VMWare, added couple of hosts using CCM and then later on deleted them.

Amazingly they are not showing up in CCM but in tactical view and I can not delete them from there.

I stored the configuration, cleared the browser cache but no effect. Pretty annoying!

I hope somebody can help. We are in the process of evaluating couple of NMS solutions and Nagios is one of those.

Thanks!

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Mon Dec 10, 2012 11:38 am
by scottwilkerson
Here is a link outlining removal process if this does happen
http://support.nagios.com/wiki/index.ph ... t_Hosts.29

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Wed Dec 12, 2012 11:08 am
by zahdin
Thanks for the reply.

I have tested that earlier. It did not help even nagios refuse to restart. Any other way to clean-up the ghost hosts/services?

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Wed Dec 12, 2012 11:13 am
by scottwilkerson
If nagios is refusing to start it is best to run the following:

From the web UI you can go to Configure -> CCM -> Tools -> Write config files

Work from the top down, fixing errors along the way and ONLY select restart nagios option once there are no errors

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Wed Dec 12, 2012 1:22 pm
by zahdin
I following the process advised, here is the error I get:

RESTART FAILED. CONFIG ERROR:
Error: There are no services defined!
Error: There are no hosts defined!

And afterwards, I want to tactical view, there were error sittings there about the non-existing hosts and I can see the same hosts+services under the "Service Detail" as well.

Thanks!

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Wed Dec 12, 2012 1:42 pm
by slansing
Were those the only errors it showed? If you enter the CCM > Tools > Write Config Files > Then click on the icons in order from top to bottom, Write, Verify, Restart. On verify can you post what it returns to you in here?

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Wed Dec 12, 2012 3:29 pm
by zahdin
While clicking on Write:

Code: Select all

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
========================================================================
While Clicking on Verify:

Error: There are no services defined! 
Error: There are no hosts defined! 

Nagios Core 3.4.1 
Copyright (c) 2009-2011 Nagios Core Development Team and Community Contributors 
Copyright (c) 1999-2009 Ethan Galstad 
Last Modified: 05-11-2012 
License: GPL 

Website: http://www.nagios.org 
Reading configuration data... 
Read main config file okay... 
Processing object config directory '/usr/local/nagios/etc/static'... 
Processing object config file '/usr/local/nagios/etc/static/xiobjects.cfg'... 
Processing object config file '/usr/local/nagios/etc/static/xitemplates.cfg'... 
Processing object config file '/usr/local/nagios/etc/static/xitest.cfg'... 
Processing object config file '/usr/local/nagios/etc/contacttemplates.cfg'... 
Processing object config file '/usr/local/nagios/etc/contactgroups.cfg'... 
Processing object config file '/usr/local/nagios/etc/contacts.cfg'... 
Processing object config file '/usr/local/nagios/etc/timeperiods.cfg'... 
Processing object config file '/usr/local/nagios/etc/commands.cfg'... 
Processing object config file '/usr/local/nagios/etc/hostgroups.cfg'... 
Processing object config file '/usr/local/nagios/etc/servicegroups.cfg'... 
Processing object config file '/usr/local/nagios/etc/hosttemplates.cfg'... 
Processing object config file '/usr/local/nagios/etc/servicetemplates.cfg'... 
Processing object config file '/usr/local/nagios/etc/servicedependencies.cfg'... 
Processing object config file '/usr/local/nagios/etc/serviceescalations.cfg'... 
Processing object config file '/usr/local/nagios/etc/hostdependencies.cfg'... 
Processing object config file '/usr/local/nagios/etc/hostescalations.cfg'... 
Processing object config file '/usr/local/nagios/etc/hostextinfo.cfg'... 
Processing object config file '/usr/local/nagios/etc/serviceextinfo.cfg'... 
Processing object config directory '/usr/local/nagios/etc/hosts'... 
Processing object config directory '/usr/local/nagios/etc/services'... 
Read object config files okay... 

Running pre-flight check on configuration data... 

Checking services... 
Error: There are no services defined! 
Checked 0 services. 
Checking hosts... 
Error: There are no hosts defined! 
Checked 0 hosts. 
Checking host groups... 
Checked 3 host groups. 
Checking service groups... 
Checked 0 service groups. 
Checking contacts... 
Checked 2 contacts. 
Checking contact groups... 
Checked 2 contact groups. 
Checking service escalations... 
Checked 0 service escalations. 
Checking service dependencies... 
Checked 0 service dependencies. 
Checking host escalations... 
Checked 0 host escalations. 
Checking host dependencies... 
Checked 0 host dependencies. 
Checking commands... 
Checked 75 commands. 
Checking time periods... 
Checked 8 time periods. 
Checking for circular paths between hosts... 
Checking for circular host and service dependencies... 
Checking global event handlers... 
Checking obsessive compulsive processor commands... 
Checking misc settings... 

Total Warnings: 0 
Total Errors: 2 

***> One or more problems was encountered while running the pre-flight check... 

Check your configuration file(s) to ensure that they contain valid 
directives and data defintions. If you are upgrading from a previous 
version of Nagios, you should be aware that some variables/definitions 
may have been removed or modified in this version. Make sure to read 
the HTML documentation regarding the config files, as well as the 
'Whats New' section to find out what has changed. 
========================================================================
While clicking on Restart:

RESTART FAILED. CONFIG ERROR:
Error: There are no services defined! 
Error: There are no hosts defined!

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Thu Dec 13, 2012 10:28 am
by mguthrie
Do you have any hosts or services defined in the CCM at this time?

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Thu Dec 13, 2012 3:44 pm
by zahdin
No, I do not have any.

Re: Ghost Host in Nagios XI 2012R1.2

Posted: Thu Dec 13, 2012 4:39 pm
by slansing
You must have one host and one service to be able to write the config files. It is a requirement. For instance localhost, and a ping of local check for the service.