-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Icinga2 API: deleting Service with cascade=1 does not delete its related dependencies #8180
Comments
I could also reproduce it with the following commands. Create a Host: Create a Service: Create Dependencies: Then I restarted icinga2 and deleted the service with the following command: Output :
Try to query for the service object:
Try to query for Dependencies: Still there
I also tried using |
Are you sure about this? |
Sorry! After: The last command causes the error. |
And of course, the service name must be removed from the query as follows. |
That way you create a Host->Host Dependency. Of course It's not being deleted.
|
My Dependencies are targeting the services, not just the hosts. For example:
provides the data:
As I mentioned in the issue description, I'm using puppet service to populate these dependencies, and using puppet-icinga. For simplicity: The Host & Service are created via the API, and the Dependencies are created via the Puppet service |
I can't reproduce it either.
|
@bobapple Does the mentioned Puppet thing uses API, packages or config files? |
The mentioned Puppet is using config files (Not sure about packages). It doesn't use the API itself.
|
Please share a step-by-step instruction to reproduce this with a fresh Icinga w/o using Puppet. |
Create 2 hosts:
Create 2 services, each one on a different host:
Create 2 Dependencies:
Show the 2 Dependencies:
Delete the service from the second host (rofl):
Query for both Dependencies:
As you can see, the Dependencies are still exist, although the child service is deleted. |
The puppet module creates plain config files. The config files are created based on the following ERB template: https://github.com/Icinga/puppet-icinga2/blob/master/templates/object.conf.erb |
@Al2Klimov Hi, |
Wouldn't hold my breath, they have a lot of bug-fixes with fairly small code changes with milestone 2.13, which is likely going to take a lot of time before it's released. Your best bet is to patch it yourself. Been doing myself like this and while it's definitely PITA it is manageable, and considering severity of some bugs, the only way to use Icinga in my case. If you are on Debian repackaging their packages with your own patch set is not particularly difficult. |
... to ensure dependencies get deleted via cascade=1. refs #8180
Describe the bug
After deleting a Service via API with parameter
cascade=1
, all of the dependencies that this Service is theirchild_service_name
aren't being deleted.Note: When deleting the Host of the Service with
cascade=1
, both the Service and the Dependencies are deleted.To Reproduce
Tested with Postman but every api solution would fit.
cascade=1
cascade=1
Expected behavior
All of the Dependencies that the Service is related to them (it is the
child_service_name
) should be deleted when the Service is deleted withcascade=1
.Your Environment
Currently tested against Icinga2 on a Docker machine. Also, I have Puppet service that runs and add configurations for Icinga as well as using the API directory.
I have dependencies that are added via Puppet, so whenever I create the Service with the API, there are Dependencies that getting created in package
_etc
.The reproduce procedure creates the Dependencies in package
_api
.Still, all Dependencies (from both packages) aren't being deleted when the Service is deleted, but only get deleted when the Host is deleted.
icinga2 - The Icinga 2 network monitoring daemon (version: r2.11.4-1)
Copyright (c) 2012-2020 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
System information:
Platform: Ubuntu
Platform version: 16.04.4 LTS (Xenial Xerus)
Kernel: Linux
Kernel version: 4.14.181-142.260.amzn2.x86_64
Architecture: x86_64
Build information:
Compiler: GNU 5.4.0
Build host: runner-ltrjqz9n-project-298-concurrent-0
Application information:
General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2
Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var
Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid
The text was updated successfully, but these errors were encountered: