I’d like to set up a service/host dependency rule that should work like follows:
HostA with check_power checks the current power status in the datacentre.
There also exists HostB, HostC, HostD with their own sets of checks etc. these are not powered by UPS.
The power goes out.
An alert is raised for check_power that the power has gone out
No other services or hosts send notifications when they go down
Would I be able to do this with something as simple as the following?
apply Dependency "check_power_dep" to Service {
parent_service_name = "check_power"
states = [ OK ] // Fail if the parent service state switches to NOT-OK
disable_notifications = true
assign where true
ignore where host.name == "HostA"
ignore where service.name == "check_power"
}
Then, if I had another check, check_network for example, could I make another dependency like the above and do ignore where service.name == “check_network” && ignore where service.name == “check_power” etc.?
@Al2Klimov I would like HostA to still send notifications in the event of a power outage, as it also checks things like DNS, network connectivity - other core things. But I don’t want all other hosts to send notifications.
apply Dependency "dev_httpd_dep" to Service {
parent_service_name = "check_dev_httpd_cluster"
states = [ OK ] // Fail if the parent service state switches to NOT-OK
disable_notifications = true
assign where true
ignore where host.name == "devrunner-will"
ignore where service.name == "check_dev_httpd_cluster"
}
The service is above, and runs on devrunner-will, which has the following config:
The error I posted is from one of the over 20K service + host combos we have (critical/config: 28547 errors), it fails with all of them, they have no relation to this particular host and service combo, but I’d like them to depend on it.