Hi, we have icinga deployed in remote location which is directly connected over 192.168.255.0/30 network with the main location. I add the host interconnect with address 192.168.255.2 which is the main location side. The check for reachability and ping4 work good. Also there is no problem with host dependency of the hosts in main location on interconnect host.
But sometimes happens that the interconnect host is reachable, only the ping4 has to high RTA value and the service goes in critical (warning) state. In that moment also hosts in main location are UP, but their services goes critical (warning).
I try to set up service-to-service dependecy, but the notifications from services are stil sent.
First time I tried with general Apply rule (commented lines were tried uncommented)
apply Dependency "ping4-interconnect" to Service {
//parent_host_name = "interconnect"
parent_service_name = "ping4"
disable_checks = true
//ignore_soft_states = false
disable_notifications = true
//states = [ OK ]
assign where service.check_command == "ping4" //assign where host.vars.location == "main"
ignore where service.name == "ping4-interconnect"
}
When this doesnât work for me, I tried with basic dependecy object
But the result is still the same when testing. Service interconnect!ping4 goes critical, the noticifation is send, testing!ping4 goes critical and the notification is send.
Here is part of debuglog, Iâm a bit confused about passed and filed dependecies
To have a Service-to-Service dependency you need to set the name of the parent host and service. Otherwise the dependency will be treated as as âlocalâ dependency for services to their own host (see https://icinga.com/docs/icinga-2/latest/doc/09-object-types/#dependency @ âService-to-Service-on-the-same-Host Dependency Exampleâ)
So if you add the parent_host_name = âinterconnectâ to the apply rule, the config should work.
The second config should also work, if the host object is named âtesting.tacr.localâ.
The debuglog output letâs me think that the name is just âtestingâ.
you need a ignore where host.name == "interconnect" for the host dependency.
Otherwise the dependency would be a loop on itself, I think.
Or does the host âinterconnectâ not have the variable location set to âmainâ?
Apart from missing states in you host dependency apply rule, though Iâm not sure if there is a default, all other dependecies are looking good to me and should work.
Just in case you have the commented apply rule like you posted in your config:
be aware that you need * in front of every line for a multi-line comment:
/* #alternative with apply rule
*apply Dependency "ping4-interconnect" to Service {
* parent_host_name = "interconnect"
* parent_service_name = "ping4"
* states = [ OK ]
* disable_checks = true
* ignore_soft_states = false
* assign where service.check_command == "ping4"
* ignore where host.name == "interconnect"
*}
*/
Yes, it has default values, according to documentation
Configuration Attributes: States - Defaults to [ OK, Warning ] for services and [ Up ] for hosts.
I used
/*
_some_
_multiline_
_configuration_
*/
through all config files and there is no problem with validation and other host disapear from web GUI.
Anyvay I tried to remove the commented code from dependencies configuration but without change.
Ok, I probably found the problem. When I omit disable-host-service-checks dependency, everything works good. I think itâs because the ping4-interconnect dependency fails correctly, but after that disable-host-service-checks dependency check testing host, which is OK and the dependency passes, so notification is sent.
[2021-01-22 14:54:51 +0100] notice/Dependency: Dependency 'testing.tacr.local!interconnect' passed: Parent host 'interconnect' matches state filter.
[2021-01-22 14:54:51 +0100] notice/Dependency: Dependency 'interconnect!ping4!disable-host-service-checks' failed: Parent host 'interconnect' is in a soft state.
[2021-01-22 14:54:51 +0100] notice/Dependency: Dependency 'interconnect!ping4!disable-host-service-checks' passed: Parent host 'interconnect' matches state filter.
-> [2021-01-22 14:54:51 +0100] notice/Dependency: Dependency 'testing.tacr.local!ping4!ping4-interconnect' failed. Parent service 'interconnect!ping4' is CRITICAL
-> [2021-01-22 14:54:51 +0100] notice/Dependency: Dependency 'testing.tacr.local!ping4!disable-host-service-checks' failed: Parent host 'testing.tacr.local' is in a soft state.
-> [2021-01-22 14:54:51 +0100] notice/Dependency: Dependency 'testing.tacr.local!ping4!disable-host-service-checks' passed: Parent host 'testing.tacr.local' matches state filter.
[2021-01-22 14:54:51 +0100] notice/Dependency: Dependency 'testing.tacr.local!interconnect' passed: Parent host 'interconnect' matches state filter.
But Iâm afraid, I cannot find solution with both dependencies
Out of interest, why did you implement the âdisable-host-service-checksâ dependency?
There already is a default implicit dependency of hosts to their own services. So if a host is down no notification will be sent for the services of that host. The only difference is that the checks are still running.
Apart from that I donât really know how to implement both without interefering with each other.
You could try setting the host check command of your âinterconnectâ host to something else than a ping check, so that the host can be UP, while the ping4 service is CRITICAL.
I received notifications when host went back to up state, but itâs services were still critical.
When no checks are running if the host is down, then in the time itâs back up, there is still time at least to one check on services (because they are in soft state) and they get ok.
If the check are done during the host down state, when the host is back up, all services are already in hard state and notifications are sent immediately.
I found this solution here
Itâs not the problem. In this situation the host interconnect remains up, even the ping service is critical, because itâs still reachable - host reachability RTA values (C,W) 100.00 ms, 200.00 ms vs ping service 3.00 s, 5.00 s
I think itâs because the the hosts states didnât changed.
Or I donât know where to find them.
Yes, I think, I canceled the test, because the ping4 on testing has been still checked.
When I removed the disable-host-service-checks the ping4 on testing turned gray and was no more checked.
Thx for the screen shots.
It really looks like the disable-host-service-checks depedency somehow interferes with the whole setup.
But I donât know why.
I found recent issuse that maybe have something to do with your problem, but Iâm not sure.
Maybe check those if they look like they might fit.
Other than that Iâm out of ideas.
Maybe someone you/of the team can have a âquickâ look at this, @theFeu ^^?