I am running Nagios XI 2014R2.7 on RHEL 6.7 and I have not been able to delete services with the script "./nagiosql_delete_service.php --config=xxx" after cd-ing into "/usr/local/nagiosxi/scripts". It claims it is successful:
URL: https://localhost/nagiosxi/includes/components/ccm/
Unable to delete host xxx. Host has dependent relationships
I did try this via the core configuration manager successfully. However, we are trying to implement some centralized management outside of the web front end. Let me know if there is any extra info you need.
The reason that you are unable to delete the host is because it has dependent relationships, as with the XI interface you need to remove all of those dependencies first.
Go into the XI interface and go to Configure > Core Config Manager > Hosts
- Find your host
- Click on the little blue circle with the i in it and it will show you the relationships that you need to remove (or remove the host from) in order to delete it.
Pres-Gas wrote:I did try this via the core configuration manager successfully.
So to be very clear you deleted the host in CCM that you were unable to delete at the command line without making any further changes or apply configs?
If so it sounds like we have a bug to chase.
If not could you please recreate the problem then view the existing dependencies by clicking the blue 'i' in the CCM interface?
jdalrymple wrote:So to be very clear you deleted the host in CCM that you were unable to delete at the command line without making any further changes or apply configs?
If so it sounds like we have a bug to chase.
If not could you please recreate the problem then view the existing dependencies by clicking the blue 'i' in the CCM interface?
Yes, I was able to remove the service checks and then host from the web interface consistently. The commandline fails as per above. What would you like from us to chase it down?
jdalrymple wrote:Probably nothing at the moment, let me create a lab environment and see if I can recreate it in-house.
It was intermittent but now seems to be consistent. Nothing has changed in NagiosXI for us (we are at the latest as per earlier post), but we have been updating the OS. Thanks for looking at it.
I can't recreate it. We'll need you to get into a state where you can't delete the host then without deleting via CCM we can maybe take a look at what you have going on.
As an alternative - I suggest if you're doing automation of hosts/service creation/deletion - make use of hostgroups so that you don't end up with any dependencies.
jdalrymple wrote:I can't recreate it. We'll need you to get into a state where you can't delete the host then without deleting via CCM we can maybe take a look at what you have going on.
As an alternative - I suggest if you're doing automation of hosts/service creation/deletion - make use of hostgroups so that you don't end up with any dependencies.
Dependencies are not the issue at this point in our setup. What info do you need me to send on when I am at this state? Problem is that the deletion of services does say it is successful, but the services are still there.
Try running the reconfigure nagios script from the /usr/local/nagiosxi/scripts folder after you delete the services and see if that resolves the issue.
This seems to be resolved if i run "reconfigure_nagios.sh" in the beginning before I remove services then hosts. Then I run "reconfigure_nagios.sh" afterwards and it is successful. It is like I have to "prime the pump" first.