Can't delete service or host

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Can't delete service or host

Post by hillhealthcenter »

Hi,

I'm having trouble delete one host and it's related service.

Error: Service has no hosts and/or service_description (config file '/usr/local/nagios/etc/services/antek-server.cfg', starting on line 16)

Here are the contents of the file

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:       2014-06-04 13:24:21
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
        host_name                       antek-server
        service_description             Ping
        use                             xiwizard_windowsserver_ping_service
        max_check_attempts              5
        check_interval                  5
        retry_interval                  1
        check_period                    xi_timeperiod_24x7
        notification_interval           60
        notification_period             xi_timeperiod_24x7
        contacts                        nagiosadmin
        _xiwizard                       windowsserver
        register                        1
        }

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
Nagios XI Version : 2014R1.4
2.6.32-220.23.1.el6.i686 i686
CentOS release 6.2 (Final)
Thanks so much,
Tom
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Can't delete service or host

Post by tmcdonald »

In the Core Configuration Manager, you can either delete that service or attach it to a host then click Apply Config again.
Former Nagios employee
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Can't delete service or host

Post by hillhealthcenter »

tmcdonald,

Thanks for getting back to me.

I'm still getting the same error.
Thanks so much,
Tom
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Can't delete service or host

Post by tmcdonald »

Go ahead and remove the /usr/local/nagios/etc/services/antek-server.cfg file from the command line, then re-run Apply Config. Chances are there will be other services like this, in which case they too will need to be removed.
Former Nagios employee
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Can't delete service or host

Post by hillhealthcenter »

I deleted the file from the command and verified that it was no longer listed the directory.
I clicked Apply at the CCM then file was recreated.
I still cannot successfully remove the service and the related host.
Thanks so much,
Tom
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Can't delete service or host

Post by lmiltchev »

I deleted the file from the command and verified that it was no longer listed the directory.
I clicked Apply at the CCM then file was recreated.
This config is being pulled from somewhere... Are you sure it is not still in the database (CCM)? Are you reverting to the last good configuration because of config errors? Try removing the service again from the CLI, but instead of applying configuration directly, run the Write Config Tool, and observe the output for errors. If there are no errors, apply configuration.
Be sure to check out our Knowledgebase for helpful articles and solutions!
EnvBroker1
Posts: 65
Joined: Thu Oct 31, 2013 11:50 am

Re: Can't delete service or host

Post by EnvBroker1 »

I had the problem where after making a lot of changes to fix problems, one big fatal error and it reverted back to the last know good config. I didn't notice that at first so I was confused until I picked up on that. Check the date on the file and if it's days ago then that's one problem. Until I fixed this, I would make a copy of the file I had fixed, just it case it was over written again.

In the CCM, if you find that service and click on the I button, it's supposed to tell you what the dependencies are so you can continue to track down where the actual problem is.

Anyway, that's some of the stuff I went through before I even got my first good verification to run.

Hope that's helpful.
hillhealthcenter
Posts: 174
Joined: Fri Sep 21, 2012 7:45 am
Location: New Haven, CT

Re: Can't delete service or host

Post by hillhealthcenter »

This is what I get after deleting the .cfg file then click the Write button under Write Configs To File.

Code: Select all

Write host configurations ...
Host configuration files successfully written!

Write service configurations ...
Configuration file: antek-server.cfg successfully written!
Service configuration files successfully written!

Configuration file: hostgroups.cfg successfully written!
Configuration file: servicegroups.cfg successfully written!
Configuration file: hosttemplates.cfg successfully written!
Configuration file: servicetemplates.cfg successfully written!
Configuration file: timeperiods.cfg successfully written!
Configuration file: commands.cfg successfully written!
Configuration file: contacts.cfg successfully written!
Configuration file: contactgroups.cfg successfully written!
Configuration file: contacttemplates.cfg successfully written!
Configuration file: servicedependencies.cfg successfully written!
Configuration file: hostdependencies.cfg successfully written!
Configuration file: serviceescalations.cfg successfully written!
Configuration file: hostescalations.cfg successfully written!
Configuration file: serviceextinfo.cfg successfully written!
Configuration file: hostextinfo.cfg successfully written!
Thanks so much,
Tom
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Can't delete service or host

Post by tmcdonald »

lmiltchev wrote:[...] run the Write Config Tool, and observe the output for errors. If there are no errors, apply configuration.
Did you apply config? If so, were there errors?
Former Nagios employee
Locked