Use arrays in the Icinga 2 example config

This commit is contained in:
Gunnar Beutner 2014-11-05 09:49:59 +01:00
parent 45d3005f3c
commit f6595267d6
1 changed files with 7 additions and 7 deletions

View File

@ -76,7 +76,7 @@ __function createService(service_type, num) {
enable_active_checks = (service_type != "pending")
vars.check_type = service_type
assign where match("*" + service_type + "*", host.vars.check_config)
assign where service_type in host.vars.check_config
}
}
@ -102,12 +102,12 @@ __function createHost(checkType, checkConfig, num, checkEnabled) {
}
__for (num in range(10)) {
createHost("ok", "ok", num, true)
createHost("random", "random,flapping", num, true)
createHost("down", "warning,critical", num, true)
createHost("unreachable", "unknown", num, true)
createHost("pending", "pending", num, false)
createHost("flap", "flapping", num, true)
createHost("ok", [ "ok" ], num, true)
createHost("random", [ "random", "flapping" ], num, true)
createHost("down", [ "warning", "critical" ], num, true)
createHost("unreachable", [ "unknown" ], num, true)
createHost("pending", [ "pending" ], num, false)
createHost("flap", [ "flapping" ], num, true)
}
// EOF