1
0

Fix bug with ignoring multiple controllers.

This commit is contained in:
2017-12-05 13:14:33 +01:00
parent cc203d3bcb
commit 6adf530b70
4 changed files with 13 additions and 7 deletions

View File

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

View File

@ -11,14 +11,16 @@
def inventory_lynx_rct5023g_fan(info): def inventory_lynx_rct5023g_fan(info):
inventory = [] inventory = []
for OID_END, name, label, f1name, f2name, f3name, f1stat, f2stat, f3stat in info: for OID_END, name, label, f1name, f2name, f3name, f1stat, f2stat, f3stat in info:
inventory.append( (name, None) ) sub_oid = OID_END.split(".")[5]
inventory.append( (sub_oid + " " + name, None) )
return inventory return inventory
def check_lynx_rct5023g_fan(item, _no_params, info): def check_lynx_rct5023g_fan(item, _no_params, info):
states = [ "ok", "fail", "missing" ] states = [ "ok", "fail", "missing" ]
status = 0 status = 0
for OID_END, name, label, f1name, f2name, f3name, f1stat, f2stat, f3stat in info: for OID_END, name, label, f1name, f2name, f3name, f1stat, f2stat, f3stat in info:
if item != name: sub_oid = OID_END.split(".")[5]
if item != sub_oid + " " + name:
continue continue
f1stat = states[int(f1stat)] f1stat = states[int(f1stat)]

View File

@ -11,13 +11,15 @@
def inventory_lynx_rct5023g_power(info): def inventory_lynx_rct5023g_power(info):
inventory = [] inventory = []
for OID_END, name, label, p1name, p1stat, p1volt, p1temp, p2name, p2stat, p2volt, p2temp in info: for OID_END, name, label, p1name, p1stat, p1volt, p1temp, p2name, p2stat, p2volt, p2temp in info:
inventory.append( (name, None) ) sub_oid = OID_END.split(".")[5]
inventory.append( (sub_oid + " " + name, None) )
return inventory return inventory
def check_lynx_rct5023g_power(item, _no_params, info): def check_lynx_rct5023g_power(item, _no_params, info):
status = 0 status = 0
for OID_END, name, label, p1name, p1stat, p1volt, p1temp, p2name, p2stat, p2volt, p2temp in info: for OID_END, name, label, p1name, p1stat, p1volt, p1temp, p2name, p2stat, p2volt, p2temp in info:
if item != name: sub_oid = OID_END.split(".")[5]
if item != sub_oid + " " + name:
continue continue
p1volt = savefloat(p1volt)/10 p1volt = savefloat(p1volt)/10

View File

@ -11,14 +11,16 @@
def inventory_lynx_rct5023g_state(info): def inventory_lynx_rct5023g_state(info):
inventory = [] inventory = []
for OID_END, name, label, color, text in info: for OID_END, name, label, color, text in info:
inventory.append( (name, None) ) sub_oid = OID_END.split(".")[5]
inventory.append( (sub_oid + " " + name, None) )
return inventory return inventory
def check_lynx_rct5023g_state(item, _no_params, info): def check_lynx_rct5023g_state(item, _no_params, info):
ledColors = [ "unknown", "black", "green", "yellow", "red" ] ledColors = [ "unknown", "black", "green", "yellow", "red" ]
status = 0 status = 0
for OID_END, name, label, color, text in info: for OID_END, name, label, color, text in info:
if item != name: sub_oid = OID_END.split(".")[5]
if item != sub_oid + " " + name:
continue continue
color = int(color) color = int(color)