Service cannot be deleted using this method

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
Muthulinux
Posts: 12
Joined: Tue Sep 15, 2015 2:24 pm

Service cannot be deleted using this method

Post by Muthulinux »

Hi,

When i was trying to delete the service in nagios XI, I am getting below exception.

---------------------------------------------------------
Service cannot be deleted using this method
One or more errors were detected that prevent the service from being deleted.

Possible causes include...
The service is associated with other hosts, services, or objects that need to be deleted first
The service is generated by an advanced monitoring configuration entry
The service is maintained in a static or external configuration file

To resolve this issue...
Use the Nagios Core Configuration Manager to delete the service - or -
Manually delete the service definition from the appropriate external configuration file

-------------------------------------------------------------------------------------------
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Service cannot be deleted using this method

Post by bwallace »

In the Ui go to:
Configure > Core Config Manager > Services...find the service in question in the 'Actions' column on the right, click in the blue 'i" icon. This will show you the relationship info, i.e. the other hosts / services it is tied to and this is what those errors are likely alluding to:
The service is associated with other hosts, services, or objects that need to be deleted first
If in any doubt post a screenshot of it here.

Also, Check to see if there are multiple Nagios processes running, as this will cause any number of problems.

run this cmd on your nagios server:
ps - aef | grep nagios.cfg

* Look for multiple parent (PPID) processes. The Nagios process forks itself to run checks therefore subprocesses are normal. The Nagios user should probably be the only owner of the Nagios process. If in any doubt post the output here.

If there are multiple Nagios processes running, run these commands to resolve:

Code: Select all

service nagios stop
killall -9 nagios
service nagios start
Be sure to check out the Knowledgebase for helpful articles and solutions!
Muthulinux
Posts: 12
Joined: Tue Sep 15, 2015 2:24 pm

Re: Service cannot be deleted using this method

Post by Muthulinux »

Hello,

I am able to see below service in the dashboard but when I go to core config manager to delete that service it is not showing there.

TCP Port 5081 Critical 26d 11h 10m 19s 5/5 2016-10-22 10:38:49 connect to address x.x.x.x and port 5081: Connection refused

I did below steps in the server as well but still unable to delete the service. Pls help me out from this trap

service nagios stop

killall -9 nagios

service nagios start
Muthulinux
Posts: 12
Joined: Tue Sep 15, 2015 2:24 pm

Re: Service cannot be deleted using this method

Post by Muthulinux »

Hello,

I am not able to remove the services. below is the method that i used

checked the service dependencies which i want to delete - No services were dependent with that service

Checked the host dependencies in which that service resides - Found that one of the other host service was dependent with this host that is why i was not able to delete the service from this host since it has dependent with other service from other host.

Finally i deleted that dependent service after which i was able to delete this service without any issue.

Thanks dear for your intervention
avandemore
Posts: 1597
Joined: Tue Sep 27, 2016 4:57 pm

Re: Service cannot be deleted using this method

Post by avandemore »

Glad to hear your issue is resolved. Is it okay to lock this thread?
Previous Nagios employee
Locked