Module: check_mk
Branch: master
Commit: 6e16189d4e2b06125b4e43cd51e9900c1d288d7f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6e16189d4e2b06…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 23 17:54:27 2011 +0200
Added man pages for brocade_fcport
---
checkman/brocade_fcport | 138 +++++++++++++++++++++++++++++++++++++++++++++++
checks/brocade_fcport | 8 ++--
2 files changed, 142 insertions(+), 4 deletions(-)
diff --git a/checkman/brocade_fcport b/checkman/brocade_fcport
new file mode 100644
index 0000000..0a0ff8e
--- /dev/null
+++ b/checkman/brocade_fcport
@@ -0,0 +1,138 @@
+title: Monitor FibreChannel ports of Brocade FC switches
+agents: snmp
+author: Mathias Kettner <mk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This checks monitors a FibreChannel port of a Brocade FC switch
+ to very great detail. It obsoletes the older checks {fc_brocade_port} and
+ {fc_brocade_port_detailed}. The check goes critical under the following conditions:
+
+ {[1]} The physical state, operational state or adminstrative state of the port is not
+ as expected.
+
+ {[2]} The current or averaged throughput exceeds certain absolute or
+ percentual levels.
+
+ {[3]} An error counter exceeds its configured levels (CRC errors, Enc-OUT
+ 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.
+ In that case the check produces additional performance data for each parameter
+ and all warning/error levels are only applied on the averaged value, not on
+ the current one. This is especially helpful when using levels on the throughput.
+
+item:
+ The item is the port-number as two-digit or three-digit string (on switches
+ with 100 or more ports) as printed on the switch (note: the SNMP-index of
+ port {00} is {1}!). For ISL ports (inter-switch-links), an {ISL} is appended
+ to the item, e.g. {00 ISL}. That allows you to create rules that select
+ different check parameters for ISL and normal ports without specifying each
+ individual port. Also if you have configured port names, they will appear
+ in the check item (and thus the service description). This can be turned
+ off.
+
+examples:
+ # Generally turn on averaging with 15 Minutes on all ports:
+ brocade_fcport_default_levels["average"] = 15
+
+ # Alternative: set all default parameters at once:
+ 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
+ "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
+ "bw": (80.0, 90.0), # percentual levels for throughput
+ "average": 30, # apply all levels on 30 minute average
+ }
+
+ # Set traffic levels to 80/90% on ISL ports
+ check_parameters += [
+ ( { "bw" : (80.0, 90.0) }, ALL_HOSTS, [ "Port .* ISL" ]),
+ ]
+
+ # Ignore port states on non-ISL ports
+ check_parameters += [
+ ( { "phystate" : None, "opstate" : None }, ALL_HOSTS, [ "!Port .* ISL", "Port" ]),
+ ]
+
+
+perfdata:
+ For each port there are sent {in}, {out}, {rxframes}, {txframes}, {rxcrcs},
+ {rxencoutframes}, {c3discards} and {notxcredits}. If averaging is turned on, then
+ each value comes twices: once normal and once with {_avg} appended as averaged
+ value. All rates are in Bytes/s or Frames/s. If you are using PNP4Nagios, then
+ you are strongly encouraged to set {RRD_STORAGE_TYPE = MULTIPLE} in
+ {process_perfdata.cfg}. Please note, that you need to re-create or convert existing
+ RRD database if you change this setting.
+
+inventory:
+ The inventory creates checks for all operational ports. What this exactly means,
+ can be configured (see CONFIGURATION VARIABLES).
+
+[parameters]
+parameters (dict): This check works with dictionary based parameters. The
+ following keys are allowed:
+
+ {"bw"}: A pair of warn / crit levels on the throughput. Floating point
+ numbers are interpreted as percentages of the maximum bandwidth of
+ the port, e.g. {(80.0, 90.0)}. Integer numbers are interpreted as megabytes,
+ e.g. {(100, 150)}.
+
+ {"assumed_speed"}: On some older devices the automatic detection of the
+ link speed does not work. You can set the assumed link speed (in GBit/s)
+ here (example: {2.0})
+
+ {"rxcrcs"}: A pair of percentages of the maximum allowed CRC errors on
+ received frames. The default is set to {(3.0, 20.0)}, which will warn
+ at 3% and be critical at 20% of errors.
+
+ {"rxencoutframes"}: A pair of percentages for the Enc-Out frames rate. The
+ default is {(3.0, 20.0)}.
+
+ {"notxcredits"}: A pair of percentages for no-TxCredits errors. The default
+ is {(3.0, 20.0)}.
+
+ {"c3discards"}: A pair of percentages for the C3 discards. The default is
+ {(3.0, 20.0)}.
+
+ {"average"}: A number in minutes. If this parameter is set, then averaging
+ is turned on and all levels will be applied to the averaged values, not the
+ the current ones. Per default, averaging is turned off.
+
+ {"phystate"}: The expected physical state of the port or {None} if that should
+ not be checked.
+
+ {"opstate"}: The expected operational state of the port or {None} if that should
+ not be checked.
+
+ {"admstate"}: The expected adminstrative state of the port of {None} if that should
+ not be checked.
+
+
+[configuration]
+brocade_fcport_inventory_phystates(list): If list of physical states that ports
+ must have in order to be inventorized. The default value is {[ 3, 4, 5, 6, 7, 8, 9, ]}.
+ Possible are: {1}: noCard, {2}: noTransceiver, {3}: laserFault, {4}: noLight,
+ {5}: noSync, {6}: inSync, {7}: portFault, {8}: diagFault and {9}: lockRef.
+
+brocade_fcport_inventory_opstates(list): The list of operational states inventorized
+ ports must have to be inventorized. The default is {[ 1, 2, 3, 4, ]}. Possible are:
+ {0}: unknown, {1}: online, {2}: offline, {3}: testing, {4}: faulty.
+
+brocade_fcport_inventory_admstates(list): The list of adminstrative states inventorized
+ ports must have. The default is {[ 1, 3, 4, ]}. Possible are:
+ {1}: online, {2}: offline, {3}: testing, {4}: faulty.
+
+brocade_fcport_inventory_use_portname(boolean): If you set this to {True}, then
+ configured names of the ports appear in the service descripion (and thus can
+ also be used for check parameter rules). This uses the SNMP OID {swFCPortName}.
+ The default is {True}.
+
+brocade_fcport_inventory_show_isl(boolean): If you set this {True} (which is the default),
+ then {ISL} will be appended to the port name if that port is in inter-switch-link.
+
+brocade_fcport_default_levels(dict): The default check parameters for all ports.
+ These can be overridden (also partially) by {check_parameters}.
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index fe851fd..58f0ef2 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -44,10 +44,10 @@ brocade_fcport_inventory_show_isl = True # add "ISL" to service description
check_default_levels["brocade_fcport"] = "brocade_fcport_default_levels"
factory_settings["brocade_fcport_default_levels"] = {
- "rxcrcs": (3.0, 20.0),
- "rxencoutframes": (3.0, 20.0),
- "notxcredits": (3.0, 20.0),
- "c3discards": (3.0, 20.0),
+ "rxcrcs": (3.0, 20.0), # allowed percentage of CRC errors
+ "rxencoutframes": (3.0, 20.0), # allowed percentage of Enc-OUT Frames
+ "notxcredits": (3.0, 20.0), # allowed percentage of No Tx Credits
+ "c3discards": (3.0, 20.0), # allowed percentage of CRC errors
"assumed_speed": 2.0, # used, if speed not available in SNMP data
}
Module: check_mk
Branch: master
Commit: 8da1da9ab9e7dc9ba6d645a4d288565aec720b2d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8da1da9ab9e7dc…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 23 15:00:57 2011 +0200
FIX: fix several problems in brodade_fcport
---
ChangeLog | 6 ++++--
checks/brocade_fcport | 39 +++++++++++++++++++++------------------
2 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index b46672e..b522f3b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,15 +3,17 @@
* FIX: sort output of cmk --list-hosts alphabetically
Checks & Agents:
+ * FIX: brocade_fcport: port numbers where shifted by one
+ * FIX: brocade_fcport: inventory handles invalid data better
+ * FIX: brocade_fcport: add missing perfdata for frames
* FIX: apc_symmetra: fix remaining runtime calculation (by factor 100)
* brocade_port: check for Brocade FC ports has been rewritten with
lots of new features.
* AIX agent now simulates <<<netctr>>> output (by Jörg Linge)
- * brocade_fcport: inventory handles invalid data better
Multisite:
- * Introduced basic infrastructure for multilanguage support in Multisite
* FIX: make non-Ascii characters in services names work again
+ * Introduced basic infrastructure for multilanguage support in Multisite
WATO:
* Configration files can now be administered via the WEB UI
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index 56d09a9..7da3826 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -64,6 +64,7 @@ def brocade_fcport_getitem(ports, index, portname, is_isl):
def inventory_brocade_fcport(checkname, info):
+ # info[0] is port table, info[1] is ISL table
if len(info) != 2:
return
@@ -72,17 +73,17 @@ def inventory_brocade_fcport(checkname, info):
if len(info) > 1:
isl_ports = dict(info[1])
- for item in info[0]:
- if len(item) == 14:
+ for line in info[0]:
+ if len(line) == 14:
try:
- index = int(item[0])
- phystate = int(item[1])
- opstate = int(item[2])
- admstate = int(item[3])
+ index = int(line[0])
+ phystate = int(line[1])
+ opstate = int(line[2])
+ admstate = int(line[3])
except: # missing vital data. Skipping this port
continue
- portname = item[13]
- is_isl = item[0] in isl_ports
+ portname = line[13]
+ is_isl = line[0] in isl_ports
if admstate in brocade_fcport_inventory_admstates and \
opstate in brocade_fcport_inventory_opstates and \
@@ -97,24 +98,19 @@ def inventory_brocade_fcport(checkname, info):
def check_brocade_fcport(item, params, info):
# Accept item, even if port name or ISL state has changed
- item_index = int(item.split()[0])
+ item_index = int(item.split()[0]) + 1 # we substracted 1 at inventory
portinfo = [ line for line in info[0] if int(line[0]) == item_index ]
- if len(portinfo) < 1:
- return (3, "UNKOWN - Port not found in SNMP data")
-
- isl_ports = dict(info[1])
-
- # Prepare data, convert to int
index, phystate, opstate, admstate, txwords, rxwords, txframes, rxframes, \
notxcredits, rxcrcs, rxencoutframes, c3discards, speed = map(int, portinfo[0][:-1])
-
+
summarystate = 0
output = []
perfdata = []
# Lookup port speed in ISL table for ISL ports (older switches do not provide this
# information in the normal table)
+ isl_ports = dict(info[1])
if str(index) in isl_ports:
gbit = float(int(isl_ports.get(str(index))) / 16)
speedmsg = ("ISL at %.0fGbit/s" % gbit)
@@ -134,8 +130,6 @@ def check_brocade_fcport(item, params, info):
# Now check rates of various error counters
this_time = time.time()
try:
- timedif, rxframes_rate = get_counter("brocade_fcport.rxframes.%s" % index, this_time, rxframes)
- timedif, txframes_rate = get_counter("brocade_fcport.txframes.%s" % index, this_time, txframes)
timedif, rxwords_rate = get_counter("brocade_fcport.rxwords.%s" % index, this_time, rxwords)
timedif, txwords_rate = get_counter("brocade_fcport.txwords.%s" % index, this_time, txwords)
@@ -179,6 +173,15 @@ def check_brocade_fcport(item, params, info):
summarystate = max(1, summarystate)
output.append(" >= %s/s(!!)" % (get_bytes_human_readable(warn_bytes)))
+ # R X F R A M E S & T X F R A M E S
+ # Put number of frames into performance data (honor averaging)
+ timedif, rxframes_rate = get_counter("brocade_fcport.rxframes.%s" % index, this_time, rxframes)
+ timedif, txframes_rate = get_counter("brocade_fcport.txframes.%s" % index, this_time, txframes)
+ for what, value in [ ("rxframes", rxframes_rate), ("txframes", txframes_rate) ]:
+ perfdata.append((what, value))
+ if average:
+ timedif, value = get_average("brocade_fcport.%s.%s.avg" % (what, item), this_time, value, average)
+ perfdata.append( ("%s_avg" % what, value) )
# E R R O R C O U N T E R S
# handle levels on error counters
Module: check_mk
Branch: master
Commit: 4379c8b099d0284737c31a1a872a2943f8e5eaeb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4379c8b099d028…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon May 23 08:27:14 2011 +0200
Updated bug entries
---
.bugs/281 | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/.bugs/281 b/.bugs/281
new file mode 100644
index 0000000..f53aed7
--- /dev/null
+++ b/.bugs/281
@@ -0,0 +1,12 @@
+Title: Make visibility of Views in Snapin customizable
+Component: multisite
+Benefit: 3
+State: open
+Cost: 3
+Date: 2011-05-23 08:25:51
+Class: feature
+
+We could add a button "Customize". When you press it, then next to
+each view in the sidebar snapin "Views" a checkbox appears. With
+that you can select those views that should be visible. That should
+be persistet per user.