Hi everyone, i programmed an SNMP Check for a Solar Heat Pump:
(Checkmk Enterprise 2.0.0p3)
Check is called: speichertemp_wp_mitte
Host: Anlagenregler_ISP001_A
You are using the old Plugin API/Syntax here. While this still works for 2.0.0 I never the less wanted to mention this.
I think there are two things which prevent the plugin to be working. First the snmp_info line and secound the !=None comparison in the snmp_scan_function. By adding an/some additional v into the commandline the command gets move verbose and may help debug this.
The snmp_info info is as far as I know focus on tables, so you need to provide it with a table and the columns you want it to retrieve. So ('.1.3.6.1.4.1.31977.4.3.1.3', ['525']) should force it to get the field you asked for.
The snmp_scan_function should work just fine without the != none or replaced with is not None.
I was struggling with the new API with the same results until i found my error - i placed the check in the wrong folder - in checkmk 2.0 all scripts go into local/lib/check_mk/base/plugins/agent_based/
The check stated above works fine, but in the meantime i programmed it with the new API as follows:
def check_speichertemp_wp_unten(section):
speicher_temp = int(section[0][0]) / 10
state = State.UNKNOWN
if speicher_temp <= 26:
state = State.CRIT
if speicher_temp <= 26:
state = State.CRIT
if speicher_temp >= 27 and speicher_temp <= 28:
state = State.WARN
if speicher_temp >= 29 and speicher_temp <= 55:
state = State.OK
if speicher_temp >= 56 and speicher_temp <= 59:
state = State.WARN
if speicher_temp >= 60:
state = State.CRIT
yield Metric("Speichertemperatur", speicher_temp, levels=(56,60), boundaries=(0,100))
yield Result(
state=state,
summary="Speichertemperatur Wärmepumpe Unten: % 6.2f° Celcius" % (speicher_temp)
)
return