Hi,
I often have to deal with weird units returned by snmp devices (like temp values * 10; 34,2 degrees = 342). Warn an crit values are no problem but the frontend users in icingaweb2 may don’t know the correct interpretation of the value. I know I could write a python/bash wrapper script to get the snmp value, calculate it to my desired unit and output it back to icinga2 but it would be cool to use just a simple closure script to edit values like below in var.snmp_perfdata
:
apply Service for (snmp_command => command in host.vars.snmp) {
import "generic-service"
check_command = "snmp"
display_name = snmp_command
vars.snmp_oid = command.oid
vars.snmp_warn = command.warn
vars.snmp_crit = command.crit
vars.snmp_perfdata = {
return command.perfdata / 10
}
assign where host.vars.snmp
}
Does this make sense? Is there any interest in this? Does it make sense to file this in github? I would expect it would take a lot of effort…