Errors after deleting Services and then Hosts ...

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Errors after deleting Services and then Hosts ...

Post by PhilG »

Hello:
We are running Nagios XI 2014R1.5.

1). I'm starting fresh and have deleted all my Services, Apply Configuration, and then Write Config files:
Write, Verify, and Restart
and then deleted all my Hosts, Apply Configuration, and then Write Config files:
Write, Verify, and Restart

2). I went into Configure - Advanced Configuration - Tools - Write Config Files - Delete (Delete All Host/Service Configuration Files):
"Successfully deleted all Host / Service Config Files"

3). I clicked "Restart" and received:
"RESTART FAILED. CONFIG ERROR:
Error: Could not find any host matching 'localhost' (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 37)
Error: Could not expand members specified in hostgroup (config file '/usr/local/nagios/etc/hostgroups.cfg', starting on line 37)
"

4). I noted the red asterisk to the left of Quick Tools - "Apply Configuration", and clicked on that.

5). I received the error message:
" Command submitted for processing...
Waiting for configuration verification........
Configuration verification failed.
"

6). I clicked on "Show config changes" and the following appeared:
"Write host configurations ...
***MY NOTE: There are over 200 of these which were my Hosts before deletion***
WARNING! Ghost host config detected! Removing the file <Host DNS Name>.cfg"
Host configuration files successfully written!
.
.
Write service configurations ...
***MY NOTE: There are 6 of these***
WARNING! Ghost service config detected! Removing the file <Host DNS Name>.cfg
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!


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



Please assist so I can get this working properly! Thank you.
Newbie '14
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: Errors after deleting Services and then Hosts ...

Post by PhilG »

UPDATE:
I checked:
1). "Home - Details - Service Detail"
and identified 7 services still being monitored.

2)."Home - Details - Host Details"
and identified 212 Hosts still being monitored.

Am I needing to delete each service and each host in here now??

That's not good.


UPDATE:
Tried deleting one of the Services and one of the Hosts and got message:
"
Could not find a unique id for this host
Host cannot be deleted using this method
"
Newbie '14
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Errors after deleting Services and then Hosts ...

Post by abrist »

You most likely have either a number of ghost files, or some issue with your database. Go to Configure --> Write config files --> Click "delete", "write", and then "verify". Now try to apply config.
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.
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: Errors after deleting Services and then Hosts ...

Post by PhilG »

abrist wrote:You most likely have either a number of ghost files, or some issue with your database. Go to Configure --> Write config files --> Click "delete", "write", and then "verify". Now try to apply config.
Did that and got:
"Error: There are no services defined!
Error: There are no hosts defined!
Total Warnings: 0
Total Errors: 2

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

Logged on the server and went to "/usr/local/nagios/etc/hosts" and "/usr/local/nagios/etc/services" and noted those directories were populated with the same Host names as noted in CCM.

I will try the following and report back:
http://support.nagios.com/wiki/index.ph ... t_Hosts.29


UPDATE:
"RESTART FAILED. CONFIG ERROR:
Error: There are no services defined!
Error: There are no hosts defined!
"
Newbie '14
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: Errors after deleting Services and then Hosts ...

Post by PhilG »

Latest update:
1). Reboot the Nagios XI server.
2). Logged back on server as root, and verified "/usr/local/nagios/etc/hosts" and ".../services", and there were no .CFG files.
3). Logged in to CCM in a browswer.
4). Identified in "Home - Details - Service Detail" that there are 7 Hosts listed (significance is that they are listed in reverse alphabetical order, if it really matters), and identified in "Home - Details - Host Detail" that there are 212 records (hosts).
5). Went to "Configure - Advanced Configuration - Tools - Write Config Files - Delete" and get message "Successfully deleted all Host / Service Config Files"
6). Clicked on "Write" and got:
"
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!
"

7). Clicked on "Verify" and got:
"
Error: There are no services defined!
Error: There are no hosts defined!

Nagios Core 4.0.8
Copyright (c) 2009-present Nagios Core Development Team and Community Contributors
Copyright (c) 1999-2009 Ethan Galstad
Last Modified: 08-12-2014
License: GPL

Website: http://www.nagios.org
Reading configuration data...
Read main config file okay...
Read object config files okay...

Running pre-flight check on configuration data...

Checking objects...
Error: There are no services defined!
Checked 0 services.
Error: There are no hosts defined!
Checked 0 hosts.
Checked 7 host groups.
Checked 14 service groups.
Checked 10 contacts.
Checked 4 contact groups.
Checked 116 commands.
Checked 9 time periods.
Checked 0 host escalations.
Checked 0 service escalations.
Checking for circular paths...
Checked 0 hosts
Checked 0 service dependencies
Checked 0 host dependencies
Checked 9 timeperiods
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...
"

8). Clicked on "Restart" and got:
"
RESTART FAILED. CONFIG ERROR:
Error: There are no services defined!
Error: There are no hosts defined!
"

9). Noting "System Problem: Monitoring Engine Is Not Running!"

10). Still noted that there are no Hosts and Services .CFG files on the server.

How shall I fix, please?
Newbie '14
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Errors after deleting Services and then Hosts ...

Post by abrist »

It seems like the ccm is not actually writing any of the files out. Open up a ticket by sending an email to [email protected] and we will try to get you into a remote session as quickly as possible to resolve this.
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.
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: Errors after deleting Services and then Hosts ...

Post by PhilG »

abrist wrote:It seems like the ccm is not actually writing any of the files out. Open up a ticket by sending an email to [email protected] and we will try to get you into a remote session as quickly as possible to resolve this.
E-mail sent to open a ticket.
Thank you.
Newbie '14
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: Errors after deleting Services and then Hosts ...

Post by PhilG »

E-mail bounced by support stating that we do not have e-mail support.

I just called the past rep and he just sent a message to your new regional support team.

Hopefully this will get worked out.
Newbie '14
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Errors after deleting Services and then Hosts ...

Post by abrist »

Are you getting support through a reseller?
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.
PhilG
Posts: 286
Joined: Thu Jan 16, 2014 10:24 am

Re: Errors after deleting Services and then Hosts ...

Post by PhilG »

abrist wrote:Are you getting support through a reseller?

I wasn't involved with the initial purchase, but from the hard copy proposal letter for the unlimited node license and maintenance lists "Shi.com".
I've found a rep and am hoping he calls me back.
I need to know WHO I can contact on our license without getting a bounce and get this issue resolved.
Newbie '14
Locked