This corrects the attribute mongodb_address to mongodb_host, if the old attribute is set Icinga will use that and output a Log message to the Log.
refs #5817
arguments = {
"-H" = {
- value = "$mongodb_address$"
+ value = "$mongodb_host$"
description = "The hostname you want to connect to"
}
"-P" = {
}
}
- vars.mongodb_address = "$check_address$"
+ vars.mongodb_host = {{
+ var mongodbAddress = macro("$mongodb_address$")
+ var checkAddress = macro("$check_address$")
+
+ if (mongodbAddress) {
+ log(LogWarning, "CheckerComponent", "The attribute 'mongodb_address' is deprecated, use 'mongodb_host' instead.")
+ return mongodbAddress
+ } else {
+ return checkAddress
+ }
+ }}
+
vars.mongodb_perfdata = true
vars.mongodb_action = "connections"
}