Page 1 of 1
Unable to Remove Services and Host
Posted: Tue Jul 23, 2013 10:25 am
by macranes
Hello, I deleted 3 of 5 services for a host using the XI interface, but they weren't removed. I then went to CCM and the services weren't there. I then tried deleting 2 remaining from CCM but got and error when applying the configuration. I then went back to the XI interface to try and remove the services again but received an error there as well--all 5 services are still in the XI interface.
the config file is present in /usr/local/nagios/etc/services
Should i delete the config file to fix the issue?
What is the best way to fix this issue?
Thanks-
Re: Unable to Remove Services and Host
Posted: Tue Jul 23, 2013 10:41 am
by lmiltchev
You can delete the config manually only if you have a "ghost" service, meaning the service has been deleted in the CCM (from the database) but the config for some reason was left behind and you can see the service in the web interface. If the service hasn't been deleted from the database, removing the config file manually would not do the job. Service will re-appear after applying configuration.
I would start by running the Write Config Tool and verifying the configuration:
CCM->Tools->Write Config Files->Write->Verify
Fix any errors, then go to: CCM->Services->Info, in order to see if deletion is possible (if there are any database relationships for this particular service, you will have to take care of them first, before removing the service). If there are no dependencies, remove the service, and Apply Configuration.
Re: Unable to Remove Services and Host
Posted: Tue Jul 23, 2013 2:31 pm
by macranes
I used the CCM->Tools->Write Config Files->Write->Verify
I verified the configuration and fixed an error for another service that someone else setup earlier today--the service description had () in it. I tried fixing it with quotes which didn't work so i just removed the () so there is now an alert stating that it can't find the service. What is a work around for the () in the service description field?
After I fixed the error, I used the CCM->Tools->Write Config Files->Write->Verify and restarted Nagios since there weren't any errors.
I checked/verified that the services that I want to delete are not in CCM. CCM->Services-> "services to be deleted".
I checked/verified that the services are still in XI: XI->Service Detail
Does this mean that the services and host are removed from the database and there are ghost services and host and it is ok to delete the service and host config files?
thanks-
Re: Unable to Remove Services and Host
Posted: Tue Jul 23, 2013 3:00 pm
by slansing
Yes you are fine deleting the local config files from /usr/local/nagios/etc/.
Then re-run the write config tool once more and you should be clean.
Re: Unable to Remove Services and Host
Posted: Thu Jul 25, 2013 10:36 am
by macranes
Thank you. The issue is fixed.
Re: Unable to Remove Services and Host
Posted: Thu Jul 25, 2013 11:11 am
by abrist
Great, locking 'er up.