Module: check_mk
Branch: master
Commit: 7d2ddc6f2dadae881da392214dce16907acd3666
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7d2ddc6f2dadae…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Wed Jun 29 16:20:06 2016 +0200
3689 brocade_fcport: now monitors BBcredit zero stats and the number of encoding error or
disparity error inside frames received
---
.werks/3689 | 9 +++++++++
ChangeLog | 1 +
checkman/brocade_fcport | 2 +-
checks/brocade_fcport | 21 ++++++++++++++++++---
web/plugins/metrics/check_mk.py | 33 ++++++++++++++++++++++++++-------
web/plugins/wato/check_parameters.py | 9 +++++++++
6 files changed, 64 insertions(+), 11 deletions(-)
diff --git a/.werks/3689 b/.werks/3689
new file mode 100644
index 0000000..aaf4940
--- /dev/null
+++ b/.werks/3689
@@ -0,0 +1,9 @@
+Title: brocade_fcport: now monitors BBcredit zero stats and the number of encoding error
or disparity error inside frames received
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1467209823
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 9fd0561..9c4eef9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -107,6 +107,7 @@
* 2240 check_mk_agent.openwrt: New agent for OpenWRT based systems...
* 3684 infoblox_systeminfo: new inventory plugin for Infoblox devices which support
the IB-PLATFORMONE MIB
* 3688 perle_chassis, perle_chassis.temp, perle_chassis_slots, perle_modules_cm1000,
perle_modules_cm1110, perle_modules_mgt, perle_psmu, perle_psmu.fan: new checks for Perle
Mediaconverter devices which support the PERLE-MCR-MGT MIB
+ * 3689 brocade_fcport: now monitors BBcredit zero stats and the number of encoding
error or disparity error inside frames received
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checkman/brocade_fcport b/checkman/brocade_fcport
index a17ef09..6cef3de 100644
--- a/checkman/brocade_fcport
+++ b/checkman/brocade_fcport
@@ -15,7 +15,7 @@ description:
percentual levels.
{[3]} An error counter exceeds its configured levels (CRC errors, Enc-OUT
- frames, no Tx credits, C3 discards)
+ Enc-IN, frames, no Tx credits, C3 discards)
Averaging: This check supports averaging on all counters. Averaging is
turned on but setting the check parameter {"average"} to a number of minutes.
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index 1969573..cb205b4 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -100,6 +100,7 @@ brocade_fcport_inventory = []
factory_settings["brocade_fcport_default_levels"] = {
"rxcrcs": (3.0, 20.0), # allowed percentage of CRC errors
"rxencoutframes": (3.0, 20.0), # allowed percentage of Enc-OUT Frames
+ "rxencinframes": (3.0, 20.0), # allowed percentage of Enc-In Frames
"notxcredits": (3.0, 20.0), # allowed percentage of No Tx Credits
"c3discards": (3.0, 20.0), # allowed percentage of C3 discards
"assumed_speed": 2.0, # used if speed not available in SNMP
data
@@ -135,7 +136,7 @@ def inventory_brocade_fcport(info):
isl_ports = dict(info[1])
for line in info[0]:
- if len(line) == 14:
+ if len(line) >= 14:
try:
index = int(line[0])
phystate = int(line[1])
@@ -162,7 +163,7 @@ def check_brocade_fcport(item, params, info):
item_index = int(item.split()[0])
portinfo = [ line for line in info[0] if int(line[0]) == item_index + 1]
index, phystate, opstate, admstate, txwords, rxwords, txframes, rxframes, \
- notxcredits, rxcrcs, rxencoutframes, c3discards = map(int, portinfo[0][:-2])
+ notxcredits, rxcrcs, rxencinframes, rxencoutframes, c3discards = map(int,
portinfo[0][:-2])
speed = saveint(portinfo[0][-2])
summarystate = 0
@@ -277,6 +278,7 @@ def check_brocade_fcport(item, params, info):
for descr, counter, value, ref in [
("CRC errors", "rxcrcs", rxcrcs,
rxframes_rate, ),
("ENC-Out", "rxencoutframes",
rxencoutframes, rxframes_rate, ),
+ ("ENC-In", "rxencinframes",
rxencinframes, rxframes_rate, ),
("C3 discards", "c3discards",
c3discards, txframes_rate, ),
("no TX buffer credits", "notxcredits",
notxcredits, txframes_rate, ),]:
per_sec = get_rate("brocade_fcport.%s.%s" % (counter, index),
this_time, value)
@@ -303,7 +305,7 @@ def check_brocade_fcport(item, params, info):
text += ", Avg: %.2f%%" % (rate * 100.0)
error_percentage = rate * 100.0
- warn, crit = params[counter]
+ warn, crit = params.get(counter, (None, None))
if crit != None and error_percentage >= crit:
summarystate = 2
text += "(!!)"
@@ -353,6 +355,13 @@ def check_brocade_fcport(item, params, info):
summarystate = 2
output.append("Adm:%s(%d)%s" % (brocade_fcport_admstates.get(admstate,
"unknown"), admstate, errorflag))
+ if info[3]:
+ for oidend, bbcredit in info[3]:
+ if index == int(oidend.split(".")[-1]):
+ bbcredit_rate = get_rate("brocade_fcport.bbcredit.%s" %
(item),
+ this_time, binstring_to_int(bbcredit))
+ perfdata.append( ("fc_bbcredit_zero", bbcredit_rate) )
+
return (summarystate, ', '.join(output), perfdata)
check_info["brocade_fcport"] = {
@@ -372,6 +381,7 @@ check_info["brocade_fcport"] = {
14, # swFCPortRxFrames
20, # swFCPortNoTxCredits
22, # swFCPortRxCrcs
+ 21, # swFCPortRxEncInFrs
26, # swFCPortRxEncOutFrs
28, # swFCPortC3Discards
35, # swFCPortSpeed, deprecated from at least firmware version 7.2.1
@@ -389,6 +399,11 @@ check_info["brocade_fcport"] = {
"2.2.1.3", # ifType, needed to extract fibre channel ifs only
(type 56)
"31.1.1.1.15", # IF-MIB::ifHighSpeed
]),
+ # Not every device supports that
+ (".1.3.6.1.3.94.4.5.1", [
+ OID_END,
+ "8", # FCMGMT-MIB::connUnitPortStatCountBBCreditZero
+ ]),
],
'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.1588.2.1.1") \
and
oid(".1.3.6.1.4.1.1588.2.1.1.1.6.2.1.*") != None,
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index fe668e6..2570e0a 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -1862,13 +1862,25 @@ metric_info["fc_tx_frames"] = {
metric_info["fc_crc_errors"] = {
"title" : _("Receive CRC errors"),
"unit" : "1/s",
- "color" : "12/a",
+ "color" : "21/a",
}
metric_info["fc_encouts"] = {
"title" : _("Enc-Outs"),
"unit" : "1/s",
- "color" : "13/a",
+ "color" : "12/a",
+}
+
+metric_info["fc_encins"] = {
+ "title" : _("Enc-Ins"),
+ "unit" : "1/s",
+ "color" : "13/b",
+}
+
+metric_info["fc_bbcredit_zero"] = {
+ "title" : _("BBcredit zero"),
+ "unit" : "1/s",
+ "color" : "46/a",
}
metric_info["fc_c3discards"] = {
@@ -3902,6 +3914,7 @@ check_metrics["check_mk-brocade_fcport"] = {
"txframes" : { "name": "fc_tx_frames", },
"rxcrcs" : { "name": "fc_crc_errors" },
"rxencoutframes" : { "name": "fc_encouts" },
+ "rxencinframes" : { "name": "fc_encins" },
"c3discards" : { "name": "fc_c3discards" },
"notxcredits" : { "name": "fc_notxcredits" },
}
@@ -6671,11 +6684,17 @@ graph_info.append({
graph_info.append({
"title" : _("Errors"),
"metrics" : [
- ( "fc_crc_errors", "area" ),
- ( "fc_encouts", "stack" ),
- ( "fc_c3discards", "stack" ),
- ( "fc_notxcredits", "stack" ),
- ]
+ ( "fc_crc_errors", "area" ),
+ ( "fc_c3discards", "stack" ),
+ ( "fc_notxcredits", "stack" ),
+ ( "fc_encouts", "stack" ),
+ ( "fc_encins", "stack" ),
+ ( "fc_bbcredit_zero", "stack" ),
+ ],
+ "optional_metrics" : [
+ "fc_encins",
+ "fc_bbcredit_zero",
+ ],
})
graph_info.append({
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 65c3bd5..8b144ff 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2986,6 +2986,15 @@ register_check_parameters(
]
)
),
+ ("rxencinframes",
+ Tuple (
+ title = _("Enc-In frames rate"),
+ elements = [
+ Percentage( title = _("Warning at"), unit =
_("percent")),
+ Percentage( title = _("Critical at"), unit =
_("percent")),
+ ]
+ )
+ ),
("notxcredits",
Tuple (
title = _("No-TxCredits errors"),