Module: check_mk
Branch: master
Commit: 823d29b35e9373a25ef20404d1b33c5665db91f8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=823d29b35e9373…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jul 29 08:29:47 2015 +0200
#2500 FIX qlogic_fcport: Can now deal with missing port status information
Some devices, like for example QLogic 8 Gb and 4/8 Gb Intelligent Pass-thru
Modules for IBM BladeCenter do not report admin/oper-status information
for their interfaces. These interfaces are allways discovered.
---
.werks/2500 | 11 +++++++++++
ChangeLog | 1 +
checks/qlogic_fcport | 27 +++++++++++++++++++++------
3 files changed, 33 insertions(+), 6 deletions(-)
diff --git a/.werks/2500 b/.werks/2500
new file mode 100644
index 0000000..c2522e3
--- /dev/null
+++ b/.werks/2500
@@ -0,0 +1,11 @@
+Title: qlogic_fcport: Can now deal with missing port status information
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1438151316
+Class: fix
+
+Some devices, like for example QLogic 8 Gb and 4/8 Gb Intelligent Pass-thru
+Modules for IBM BladeCenter do not report admin/oper-status information
+for their interfaces. These interfaces are allways discovered.
diff --git a/ChangeLog b/ChangeLog
index b3cf5cf..543fc4e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,7 @@
* 2498 FIX: livestatus_status: Records the number of hosts/services now
* 2489 FIX: cmciii_lcp_water: New check replacing cmciii_lcp_waterin/out, support for
newer devices...
NOTE: Please refer to the migration notes!
+ * 2500 FIX: qlogic_fcport: Can now deal with missing port status information...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/qlogic_fcport b/checks/qlogic_fcport
index 4c5f279..c2b4cad 100644
--- a/checks/qlogic_fcport
+++ b/checks/qlogic_fcport
@@ -47,8 +47,11 @@ def inventory_qlogic_fcport(info):
c2_discards, c2_fbsy_frames, c2_frjt_frames, c3_in_frames, \
c3_out_frames, c3_in_octets, c3_out_octets, c3_discards in info:
- if admin_status in qlogic_fcport_inventory_admstates and \
- oper_status in qlogic_fcport_inventory_opstates:
+ # There are devices out there which are totally missing the status related
+ # SNMP tables. In this case we add all interfaces.
+ if (admin_status == '' and oper_status == '') \
+ or (admin_status in qlogic_fcport_inventory_admstates and \
+ oper_status in qlogic_fcport_inventory_opstates):
inventory.append( (qlogic_fcport_generate_port_id(port_id), None) )
return inventory
@@ -73,13 +76,18 @@ def check_qlogic_fcport(item, params, info):
message += " AdminStatus: online"
status = 0
elif admin_status == "2":
- message += "AdminStatus: offline (!!)"
+ message += " AdminStatus: offline (!!)"
status = 2
elif admin_status == "3":
- message += "AdminStatus: testing (!)"
+ message += " AdminStatus: testing (!)"
status = 1
+ elif admin_status == "":
+ # Is not a possible valid value in the MIB, but some devices don't
+ # provide status information at all (SNMP table missing).
+ message += " AdminStatus: not reported"
+ status = 0
else:
- message += "unknown AdminStatus %s (!)" % admin_status
+ message += " unknown AdminStatus %s (!)" % admin_status
status = 1
# fcFxPortPhysOperStatus
@@ -95,6 +103,11 @@ def check_qlogic_fcport(item, params, info):
elif oper_status == "4":
message += ", OperStatus: linkFailure (!!)"
status = max(status, 2)
+ elif admin_status == "":
+ # Is not a possible valid value in the MIB, but some devices don't
+ # provide status information at all (SNMP table missing).
+ message += ", OperStatus: not reported"
+ status = 0
else:
message += ", unknown OperStatus %s (!)" % oper_status
status = max(status, 1)
@@ -202,9 +215,11 @@ check_info["qlogic_fcport"] = {
]),
# .1.3.6.1.4.1.3873.1.14 Qlogic-Switch
# .1.3.6.1.4.1.3873.1.8 Qlogic-4Gb SAN Switch Module for IBM BladeCenter
+ # .1.3.6.1.4.1.3873.1.12 QLogic 8 Gb and 4/8 Gb Intelligent Pass-thru Module
'snmp_scan_function' : lambda oid: \
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.3873.1.14") \
- or
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.3873.1.8"),
+ or
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.3873.1.8") \
+ or
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.3873.1.12"),
'group': 'qlogic_fcport',
'default_levels_variable': 'qlogic_fcport_default_levels',
}