I have an oid that gives me battery percentage, I can alter warn and critic values, but I need them to work recursevely meaning, when I get 20 percent left, give me a warning, if 5% is remaining, CRITIC
Module’s conf:
commands.conf:
object CheckCommand "checkUPS" {
command = [ PluginDir + "/check_snmp"]
arguments = {
"-H" = "$snmp_address$"
"-o" = "$snmp_oid$"
"-P" = "$snmp_version$"
"-C" = "$snmp_community$"
"-w" = "$snmp_warn$"
"-c" = "$snmp_crit$"
"-u" = "$snmp_units$"
}
vars.snmp_address = "$address$"
}
services.conf:
apply Service "BatteryPercentage" {
import "generic-service"
check_command = "checkUPS"
vars.snmp_oid = "1.3.6.1.2.1.33.1.2.4.0"
vars.snmp_warn = "20"
vars.snmp_crit = "5"
vars.snmp_units = "%"
assign where host.vars.os == "ups"
}