I have a plugin which is working in CheckMK 2.3 but I can’t work out how to get it work in CheckMK 2.4
#!/usr/bin/env python3
from cmk.base.check_api import LegacyCheckDefinition
from cmk.base.config import check_info
from cmk.agent_based.v2 import any_of, SNMPTree, startswith, StringTable
def inventory_sbc_signalling(info):
inventory = []
for line in info:
inventory.append( (line[0], None, None) )
return inventory
def parse_sbc_signalling(string_table: StringTable) → StringTable:
return string_table
def check_sbc_signalling(name, params, info):
for label, enabled in info:
if name == label:
infotext = "Signal %s " % label
if int(enabled) == 1:
return (0, “OK - %s” % infotext)
else:
return (2, “CRITICAL - %s” % infotext);
check_info[‘sbc_signalling’] = LegacyCheckDefinition(
parse_function=parse_sbc_signalling,
discovery_function=inventory_sbc_signalling,
check_function=check_sbc_signalling,
service_name=“Signal %s”,
detect=any_of(
startswith(“.1.3.6.1.2.1.1.2.0”, “.1.3.6.1.4.1.177.15.1.1”),
),
fetch=SNMPTree(
base=“.1.3.6.1.4.1.177.15.1.5.4.1”,
oids=[“2”, “5”],
),
)
The device is a session border controller and it used for our telephony system
The oid .1.3.6.1.4.1.177.15.1.5.4.1.2 is a string, the name of the signal
Cheers
Wessley