Skip to content

Instantly share code, notes, and snippets.

@dnsmichi
Created July 5, 2014 17:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dnsmichi/ee485d8097531dbd3344 to your computer and use it in GitHub Desktop.
Save dnsmichi/ee485d8097531dbd3344 to your computer and use it in GitHub Desktop.
'...' 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