Page 1 of 1

Config files still show up after deleting host and services

Posted: Mon Apr 20, 2015 11:34 am
by luniversity
I had a couple of switches in my Nagios XI environment (Nagios XI 2012r1.2) that I removed from Nagios using Core Config Manager. After deleting the services and then the host I clicked "Apply Configuration" but received the following error message in the config log:
Checking services...
Checked 2146 services.
Checking hosts...
Error: 'SW - University Theatre Closet .194' is not a valid parent for host 'kvlustream.lamar.edu'!
Checked 403 hosts.
I went back into Core Config Manager and clicked on "Write Config Files" from the "Tools" menu on the left hand side. The configs seem fine no, I no longer get the error. But I was curious about the host that was mentioned in the error (kvlustream.lamar.edu) because this host and it's services were deleted sometime ago.

So grep'ed my config files for the hostname and I see where I still have config files for this host even though it does not come up when I search for it in the Nagios web interface.
[root@nagios01r6v etc]# grep kvlu /usr/local/nagios/etc/hosts/*
/usr/local/nagios/etc/hosts/kvlustream.lamar.edu.cfg: host_name kvlustream.lamar.edu
[root@nagios01r6v etc]# grep kvlu /usr/local/nagios/etc/services/*
/usr/local/nagios/etc/services/kvlustream.lamar.edu.cfg: host_name kvlustream.lamar.edu

Shouldn't those files have been deleted?

Re: Config files still show up after deleting host and servi

Posted: Mon Apr 20, 2015 11:48 am
by jolson
Those files should have been deleted, and in my testing they are. I tested on our newest version of XI (2014R2.6), so this could potentially be an issue with the 2012r1.2 version.

Could you please cat the configuration files that you mentioned?

Code: Select all

cat /usr/local/nagios/etc/hosts/kvlustream.lamar.edu.cfg

Code: Select all

cat /usr/local/nagios/etc/services/kvlustream.lamar.edu.cfg
It's possible that you have 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.

After the apply config, do the ghost files exist?