1
0

Added lynx_rct5023g.

This commit is contained in:
Markus Birth 2017-11-28 15:02:38 +01:00
parent 8df29d2741
commit 140a06bfc0
Signed by: mbirth
GPG Key ID: A9928D7A098C3A9A
5 changed files with 183 additions and 0 deletions

View File

@ -0,0 +1,7 @@
[info]
title = Lynx RCT5023g frame controller
author = Markus Birth
description = SNMP based checks (fans, PSUs, system status) for the Lynx RCT5023g frame controller.
version = 2016.07.06.1
version.min_required = 1.2.8p2
download_url = https://github.com/mbirth/check_mk-plugins

View File

@ -0,0 +1,59 @@
#!/usr/bin/python
# -*- coding: utf-8; py-indent-offset: 4 -*-
# _______ __ _ ____ __
# | | \ | |___ \ / /
# | | \| | __) | / /-,_
# | | |\ |/ __/ /__ _|
# |_______|_| \__|_____| |_|
#
# @author Markus Birth <markus.birth@weltn24.de>
def inventory_lynx_rct5023g_fan(info):
inventory = []
for OID_END, name, label, f1name, f2name, f3name, f1stat, f2stat, f3stat in info:
inventory.append( (name, None) )
return inventory
def check_lynx_rct5023g_fan(item, _no_params, info):
states = [ "ok", "fail", "missing" ]
status = 0
for OID_END, name, label, f1name, f2name, f3name, f1stat, f2stat, f3stat in info:
if item != name:
continue
f1stat = states[int(f1stat)]
f2stat = states[int(f2stat)]
f3stat = states[int(f3stat)]
if "fail" in f1stat+f2stat+f3stat:
status = 2
elif not "ok" in f1stat+f2stat+f3stat:
status = 1
message = u"%s, ❃1:%s, ❃2:%s, ❃3:%s" % (label, f1stat, f2stat, f3stat)
message += u"\r\n1: %s" % (f1name)
message += u"\r\n2: %s" % (f2name)
message += u"\r\n3: %s" % (f3name)
return status, message
return 3, "%s not found in SNMP data." % item
check_info["lynx_rct5023g_fan"] = {
"check_function" : check_lynx_rct5023g_fan,
"inventory_function" : inventory_lynx_rct5023g_fan,
"service_description" : "%s Fans",
"snmp_info" : (".1.3.6.1.4.1.14755.2", ["49672.644.1.1", "49673.644.1.1"], [
OID_END,
1, # Device name
2, # Custom name
38, # fan1Name
39, # fan2Name
40, # fan3Name
41, # fan1Status
42, # fan2Status
43, # fan3Status
]),
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.14755.2.49672.*"),
"has_perfdata" : False
}

View File

@ -0,0 +1,64 @@
#!/usr/bin/python
# -*- coding: utf-8; py-indent-offset: 4 -*-
# _______ __ _ ____ __
# | | \ | |___ \ / /
# | | \| | __) | / /-,_
# | | |\ |/ __/ /__ _|
# |_______|_| \__|_____| |_|
#
# @author Markus Birth <markus.birth@weltn24.de>
def inventory_lynx_rct5023g_power(info):
inventory = []
for OID_END, name, label, p1name, p1stat, p1volt, p1temp, p2name, p2stat, p2volt, p2temp in info:
inventory.append( (name, None) )
return inventory
def check_lynx_rct5023g_power(item, _no_params, info):
status = 0
for OID_END, name, label, p1name, p1stat, p1volt, p1temp, p2name, p2stat, p2volt, p2temp in info:
if item != name:
continue
p1volt = savefloat(p1volt)/10
p1temp = saveint(p1temp)
p2volt = savefloat(p2volt)/10
p2temp = saveint(p2temp)
if p1stat != "" or p2stat != "":
status = 2
if p1stat == "":
p1stat = "OK"
if p2stat == "":
p2stat = "OK"
message = u"%s, ⚡1:%s (%.1fV, %s℃), ⚡2:%s (%.1fV, %s℃)" % (label, p1stat, p1volt, p1temp, p2stat, p2volt, p2temp)
message += u"\r\n1: %s" % (p1name)
message += u"\r\n2: %s" % (p2name)
return status, message
return 3, "%s not found in SNMP data." % item
check_info["lynx_rct5023g_power"] = {
"check_function" : check_lynx_rct5023g_power,
"inventory_function" : inventory_lynx_rct5023g_power,
"service_description" : "%s PSU",
"snmp_info" : (".1.3.6.1.4.1.14755.2", ["49672.644.1.1", "49673.644.1.1"], [
OID_END,
1, # Device name
2, # Custom name
18, # psu1Name
19, # psu1Status
20, # psu1Voltage
21, # psu1Temp
22, # psu2Name
23, # psu2Status
24, # psu2Voltage
25, # psu2Temp
]),
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.14755.2.49672.*"),
"has_perfdata" : False
}

View File

@ -0,0 +1,53 @@
#!/usr/bin/python
# -*- coding: utf-8; py-indent-offset: 4 -*-
# _______ __ _ ____ __
# | | \ | |___ \ / /
# | | \| | __) | / /-,_
# | | |\ |/ __/ /__ _|
# |_______|_| \__|_____| |_|
#
# @author Markus Birth <markus.birth@weltn24.de>
def inventory_lynx_rct5023g_state(info):
inventory = []
for OID_END, name, label, color, text in info:
inventory.append( (name, None) )
return inventory
def check_lynx_rct5023g_state(item, _no_params, info):
ledColors = [ "unknown", "black", "green", "yellow", "red" ]
status = 0
for OID_END, name, label, color, text in info:
if item != name:
continue
color = int(color)
colorname = ledColors[color]
if colorname == "yellow":
status = 1
elif colorname == "red" or colorname == "black":
status = 2
elif colorname == "unknown":
status = 3
message = "%s, LED:%s, Status:%s" % (label, colorname, text)
return status, message
return 3, "%s not found in SNMP data." % item
check_info["lynx_rct5023g_state"] = {
"check_function" : check_lynx_rct5023g_state,
"inventory_function" : inventory_lynx_rct5023g_state,
"service_description" : "%s Status",
"snmp_info" : (".1.3.6.1.4.1.14755.2", ["49672.644.1.1", "49673.644.1.1"], [
OID_END,
1, # Device name
2, # Custom name
7, # statusColor
9, # statusText
]),
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.4.1.14755.2.49672.*"),
"has_perfdata" : False
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB