Page 1 of 1
Unable to delete hosts
Posted: Wed Jan 08, 2014 10:09 am
by WillemDH
Hello,
I've got troubles deleting some hosts. As per usual, I first deleted all the services and than tried to delete the host. But his time after applying configuration, I got some errors:
Error: Could not find any host matching 'server.gentgrp.gent.be' (config file '/usr/local/nagios/etc/services/server.cfg', starting on line 208)
Error: Could not expand hostgroups and/or hosts specified in service (config file '/usr/local/nagios/etc/services/server.cfg', starting on line 208)
Error processing object config files!
When I go into XI and search for this host (and got same problem for another host), XI still show me the services, even while they already were deleted...... When I look for services in CCM, none are shown and I get "No results returned from service table ".
Please advice what to do.
Grtz
Re: Unable to delete hosts
Posted: Wed Jan 08, 2014 10:16 am
by slansing
Re: Unable to delete hosts
Posted: Wed Jan 08, 2014 10:19 am
by WillemDH
hello,
Yes, i can find the server.cfg file is /usr/local/nagios/etc/hosts and in /usr/local/nagios/etc/services
When I nano server.cfg in usr/local/nagios/etc/services, all the services I can no longer find in CCM are still there
Grtz
Re: Unable to delete hosts
Posted: Wed Jan 08, 2014 10:25 am
by slansing
I would try following the guide I posted above, that should resolve your issue.
Re: Unable to delete hosts
Posted: Wed Jan 08, 2014 10:35 am
by WillemDH
Can you please specify which part, because none of the issue explained in the guide are exactly like the issue I'm having atm. At the moment I verified the config files, all seemed ok. The problem server was in the list though. Than I wrote the config files and restarted, but the problem persists... In XI, I can still see the services that are deleted in CCM.
Re: Unable to delete hosts
Posted: Wed Jan 08, 2014 10:40 am
by WillemDH
Ok, I deleted the server.cfg file under /etc/services and then retried to delete the host and apply, which seemed to work.. Now I'll have to do this for the other problems hosts... ANy idea what might have created this situation? And how to prevent it?
Re: Unable to delete hosts
Posted: Wed Jan 08, 2014 11:01 am
by tmcdonald
slansing's link described exactly what you did:
Host Still Visible In XI After Deletion From the CCM
Go to the Core Config Manager->Write Config Tool, and use that tool to manually write out the configuration data to file. Verify your configuration. If it verifies, go ahead and restart Nagios.
If by chance the host and all of it's services are completely deleted in the Core Config Manager, and the actual host config file is still there after using the Write Config Tool, then go ahead and delete the config file. The files will be located in the following directories.
Code: Select all
/usr/local/nagios/etc/hosts
/usr/local/nagios/etc/services
On rare occasions the CCM will somehow lose a file, we haven't nailed down what causes it, but it is usually related to deleting the host.
They are caused by a workflow similar to the following:
*Remove object from CCM (which removes it from DB but not HD)
*Make a change that would cause an error with configs
*Apply config
Basically a mismatch between database and system files.
Re: Unable to delete hosts
Posted: Wed Jan 08, 2014 11:31 am
by WillemDH
Ok, in the meantime this seems to be resolved for all problem hosts. I've tested with another host and there was no issue there. Thanks for the help.