Unable to Remove Services and Host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
macranes
Posts: 30
Joined: Fri Nov 05, 2010 7:20 am

Unable to Remove Services and Host

Post 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-
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Unable to Remove Services and Host

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
macranes
Posts: 30
Joined: Fri Nov 05, 2010 7:20 am

Re: Unable to Remove Services and Host

Post 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-
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Unable to Remove Services and Host

Post 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.
macranes
Posts: 30
Joined: Fri Nov 05, 2010 7:20 am

Re: Unable to Remove Services and Host

Post by macranes »

Thank you. The issue is fixed.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Unable to Remove Services and Host

Post by abrist »

Great, locking 'er up.
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.
Locked