Question
I’ve found several questions in the Centreon git-repo issues about how to suppress unwanted output with the --threshold-overload parameter and even some where combinations are used. My question is simply how can this be set up in Icinga where the arguments for a check command is a dictionary and will not allow for multiple instances of the same argument? Anybody got any ideas?
CLI
Command that works great
./centreon_plugins.pl --hostname 10.0.0.1 --snmp-community com --snmp-version 2 --plugin hardware::server::cisco::ucs::plugin --mode equipment --component memory --threshold-overload='memory.operability,OK,removed' --threshold-overload='memory.presence,OK,missing'
Icinga2 check
I want to have a check with optional 0-2 threshold overloads
object CheckCommand "ucs-monitor-equipment" {
import "plugin-check-command"
command = [
"/usr/local/src/centreon-plugins/centreon_plugins.pl"
]
arguments = {
"--plugin" = "hardware::server::cisco::ucs::plugin"
"--mode" = "equipment"
"--hostname" = "$address$"
"--snmp-community" = "$snmp_community$"
"--snmp-version" = "$snmp_version$"
"--component" = "$ucs_equipment_component$"
"--threshold-overload" = {
set_if = "$ucs_overload$"
value = "$ucs_threshold_overload$"
}
"--threshold-overload" = {
set_if = "$ucs_overload_2$"
value = "$ucs_threshold_overload_2$"
}
}
vars.address = "$address$"
}
And a service that will look something like this(using two overloads):
apply Service "ucs-monitor-equipment-memory" {
import "generic-service"
display_name = "UCS Memory"
vars.snmp_community = "com"
vars.ucs_equipment_component = "memory"
check_command = "ucs-monitor-equipment"
vars.ucs_overload = "true"
vars.ucs_threshold_overload="memory.presence,OK,missing"
vars.ucs_overload_2 = "true"
vars.ucs_threshold_overload_2="memory.operability,OK,removed"
vars += host.vars
assign where host.address && host.vars.os == "ucs"
ignore where host.name == "localhost" /* for upgrade safety */
}