Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'...' means something is missing
object Host "checkper1" {
import ...
check_period = "8x5" //apply rule matches
groups = [ "foo-server" ]
...
vars.has_custom_check_period = true //could be used too for apply match
}
object Host "normal" {
import ...
groups = [ "foo-server" ]
}
//8x5 service
apply Service "svc1" {
import ...
check_period = "8x5" //same as host
assign where "foo-server" in host.groups && host.check_period == "8x5"
ignore where ...
}
//normal service
apply Service "svc1" {
import ...
assign where "foo-server" in host.groups
ignore where host.check_period != "24x7" //if there's a custom check period, don't apply the default check period
}
//untested!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment