checkmk-plugins/check_ibm_flex/flex_blade_powermod

32 lines
1.0 KiB
Plaintext
Raw Normal View History

2019-08-12 11:59:29 +03:00
#!/usr/bin/python
# -*- encoding: utf-8; py-indent-offset: 4 -*-
# SpearHead Systems
#
def inventory_flex_blade_powermod(info):
return [ (line[0], '', '""') for line in info if line[1] == '1' ]
def check_flex_blade_powermod(index, _no_param, info):
for line in info:
if line[0] == index:
present, status, text = line[1:]
if present != "1":
return (2, "Not present")
elif status != "1":
return (2, "%s" % text)
else:
return (0, "%s" % text)
return (3, "Module %s not found in SNMP info" % index)
check_info["flex_blade_powermod"] = {
'check_function': check_flex_blade_powermod,
'inventory_function': inventory_flex_blade_powermod,
'service_description': 'IBM Flex Power Module %s',
'snmp_info': ('.1.3.6.1.4.1.2.3.51.2.2.4.1.1', [1, 2, 3, 4]),
'snmp_scan_function': \
lambda oid: re.match('IBM Flex Chassis Management Module', oid(".1.3.6.1.2.1.1.1.0")) != None,
}