Module: check_mk
Branch: master
Commit: 2a948c81763d63f8d794f67d17df23ae9c62cfc8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a948c81763d63…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Jun 14 13:25:55 2011 +0200
brocade_fcport: allow list of states
---
ChangeLog | 2 ++
checkman/brocade_fcport | 8 ++++----
checks/brocade_fcport | 9 ++++++---
3 files changed, 12 insertions(+), 7 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 22b4d32..458f230 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -11,6 +11,8 @@
* AIX agent now simulates <<<netctr>>> output (by Jörg Linge)
* mbg_lantime_state: Handling refclock offsets correctly now; Changed
default thresholds to 5/10 refclock offset
+ * brocade_port: parameter for phystate, opstate and admstate can now
+ also be lists of allowed states.
Multisite:
* FIX: make non-Ascii characters in services names work again
diff --git a/checkman/brocade_fcport b/checkman/brocade_fcport
index 0a0ff8e..8837d99 100644
--- a/checkman/brocade_fcport
+++ b/checkman/brocade_fcport
@@ -102,14 +102,14 @@ parameters (dict): This check works with dictionary based
parameters. The
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.
+ {"phystate"}: The expected physical state (integer) of the port or {None} if
that should
+ not be checked. It is also allowed to specify a list of allowed states, e.g. {[1, 2,
3]}.
{"opstate"}: The expected operational state of the port or {None} if that
should
- not be checked.
+ not be checked. It is also allowed to specify a list here.
{"admstate"}: The expected adminstrative state of the port of {None} if that
should
- not be checked.
+ not be checked. It is also allowed to specify a list here.
[configuration]
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index 58f0ef2..d66ee53 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -247,7 +247,8 @@ def check_brocade_fcport(item, params, info):
# P O R T S T A T E
# Port Status (physical layer)
errorflag = ""
- if params.get("phystate") != None and phystate !=
params['phystate']:
+ if params.get("phystate") != None and phystate !=
params['phystate'] \
+ and not (type(params['phystate']) == list and phystate in
params['phystate']):
# noCard (1), noTransceiver (2), laserFault (3), noLight (4),
# noSync (5), inSync (6), portFault (7), diagFault (8), lockRef (9)
if phystate in [1, 6]:
@@ -260,7 +261,8 @@ def check_brocade_fcport(item, params, info):
errorflag = ""
#unknown(0) online(1) offline(2) testing(3) faulty(4) ]
- if params.get("opstate") != None and opstate != params['opstate']:
+ if params.get("opstate") != None and opstate != params['opstate']
\
+ and not (type(params['opstate']) == list and opstate in
params['opstate']):
if opstate in [1, 3]:
errorflag = "(!)"
summarystate = max(summarystate, 1)
@@ -271,7 +273,8 @@ def check_brocade_fcport(item, params, info):
errorflag = ""
# online(1) offline(2) testing(3) faulty(4)
- if params.get("admstate") and admstate != params['admstate']:
+ if params.get("admstate") and admstate != params['admstate'] \
+ and not (type(params['admstate']) == list and admstate in
params['admstate']):
if admstate not in [2, 4]:
errorflag = "(!)"
summarystate = max(summarystate, 1)