Skip to content

Instantly share code, notes, and snippets.

@FlorianHeigl
Last active April 23, 2018 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FlorianHeigl/a7be89950428df3a33cbdfc91ac52afc to your computer and use it in GitHub Desktop.
Save FlorianHeigl/a7be89950428df3a33cbdfc91ac52afc to your computer and use it in GitHub Desktop.
bugfix for check_mk infortrend checks
#!/usr/bin/python
def inventory_controller_status(info):
inventory = []
inventory.append(("Status",None))
return inventory
def check_controller_status(item, params, info):
status = int(info[0][0])
if status == 18:
return (0,"Controller status OK")
else:
return (2,"Controller status not OK")
check_info["controller_status"] = {
'check_function': check_controller_status,
'service_description': "Infortrend Controller %s",
'inventory_function': inventory_controller_status,
'has_perfdata': False,
'snmp_info' : (".1.3.6.1.4.1.1714.1.1.1.6.4", ["0"]),
"snmp_scan_function" : lambda oid: \
"Infortrend SNMP agent" in oid(".1.3.6.1.2.1.1.1.0"),
}
#!/usr/bin/python
def inventory_infortrend_hddstatus(info):
inventory = []
ii = 0
for hdd in info[0]:
ii = ii + 1
inventory.append((int(ii),None))
return inventory
def check_infortrend_hddstatus(item, params, info):
i = 0
item = int(item)
for hdd in info[0]:
i = i + 1
if i == item:
if hdd == "1":
return (0,"HDD %i has status on-line" % (i))
elif hdd == "0xff":
return (2,"HDD %i has failed status" % (i))
else:
return (1,"HDD %i has unnormal status" % (i))
return (3,"Not a infortrend Storage ?")
check_info["infortrend_hddstatus"] = {
'check_function' : check_infortrend_hddstatus,
'service_description': "Infortrend hddstatus HDD%s",
'inventory_function' : inventory_infortrend_hddstatus,
'has_perfdata' : False,
'snmp_info' : (".1.3.6.1.4.1.1714.1.1.6.1.11",
["1","2","3","4","5","6","7","8","9","10","11","12"
]),
"snmp_scan_function" : lambda oid: \
"Infortrend SNMP agent" in oid(".1.3.6.1.2.1.1.1.0"),
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment