Page 1 of 1

unable to remove the host

Posted: Tue Jun 04, 2019 9:13 am
by IT-OPS-SYS
Hi team,

I am unable to remove the host/service from Nagios and while restarting Nagios I am getting the below error.

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/Common-Windows.cfg', starting on line 147)
Error: Could not find a service matching host name 'malvc2' and description 'Service - Virtual Center' (config file '/usr/local/nagios/etc/servicedependencies.cfg', starting on line 49)
Error: Could not expand master service(s) (config file '/usr/local/nagios/etc/servicedependencies.cfg', starting at line 49)

I deleted the service and when I am trying to delete the host I am getting an error.

Kindly help.

Re: unable to remove the host

Posted: Tue Jun 04, 2019 2:01 pm
by lmiltchev
Did you remove the host and the service from your service dependency?

CCM > Advanced > Service Dependencies > your dependency > Edit

Can you run the Config FIle Management tool and show the output?

CCM > Tools > Config File Management > Delete Files > Write Configs > Verify Files

Tip: You can temporarily deactivate your service dependency for debugging purposes, and rerun the Config FIle Management tool to see if config errors are gone.

Re: unable to remove the host

Posted: Tue Jun 11, 2019 8:44 am
by IT-OPS-SYS
what does it do : CCM > Tools > Config File Management > Delete Files > Write Configs > Verify Files

will it delete any of the config file inside the Nagios?

Re: unable to remove the host

Posted: Tue Jun 11, 2019 9:06 am
by lmiltchev
Delete Files will delete the "physical" configs on the server, but NOT the configs in the database (CCM). Other words, delete is safe (not permanent), otherwise we wouldn't put it there. If you are concerned though, you could move the files to a different location instead of deleting them, for example:

Code: Select all

mkdir /tmp/hosts /tmp/services
mv /usr/local/nagios/etc/hosts/* /tmp/hosts
mv /usr/local/nagios/etc/services/* /tmp/services
then click on "Write Configs" and "Verify Files"

Write Configs will write them back (create new physical configs on the system).

Verify Files will verify the configuration (check for errors).

Re: unable to remove the host

Posted: Tue Jun 11, 2019 9:54 am
by IT-OPS-SYS
thanks for the explanation and with this I am able to remove the host from the nagios.

thanks and you can close the thread.

Re: unable to remove the host

Posted: Tue Jun 11, 2019 10:12 am
by lmiltchev
I am glad I could help!