Module: check_mk
Branch: master
Commit: f881156a864aa838e5e500edccd75c0b14790370
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f881156a864aa8…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Apr 30 11:09:09 2012 +0200
FIX: Bugs in brocade_fcport check
---
ChangeLog | 2 +
checks/brocade_fcport | 6 ++--
web/plugins/wato/check_parameters.py | 36 +++++++++++++++++-----------------
3 files changed, 23 insertions(+), 21 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 6d7939f..df99d0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -20,6 +20,8 @@
Checks & Agents:
* FIX: Made logwatch parsing mechanism a little more robust
(Had problems with emtpy sections from windows agent)
+ * FIX: brocade_fcport: Configuration of portsates now possible
+
WATO:
* Reimplemented folder listing in host/folders module
diff --git a/checks/brocade_fcport b/checks/brocade_fcport
index 3a8074b..69304c9 100644
--- a/checks/brocade_fcport
+++ b/checks/brocade_fcport
@@ -247,7 +247,7 @@ def check_brocade_fcport(item, params, info):
# Port Status (physical layer)
errorflag = ""
if params.get("phystate") != None and phystate !=
params['phystate'] \
- and not (type(params['phystate']) == list and phystate in
params['phystate']):
+ and not (type(params['phystate']) == list and phystate in map(int,
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]:
@@ -261,7 +261,7 @@ 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']
\
- and not (type(params['opstate']) == list and opstate in
params['opstate']):
+ and not (type(params['opstate']) == list and opstate in map(int,
params['opstate'])):
if opstate in [1, 3]:
errorflag = "(!)"
summarystate = max(summarystate, 1)
@@ -273,7 +273,7 @@ def check_brocade_fcport(item, params, info):
errorflag = ""
# online(1) offline(2) testing(3) faulty(4)
if params.get("admstate") and admstate != params['admstate'] \
- and not (type(params['admstate']) == list and admstate in
params['admstate']):
+ and not (type(params['admstate']) == list and admstate in map(int,
params['admstate'])):
if admstate not in [2, 4]:
errorflag = "(!)"
summarystate = max(summarystate, 1)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 51bafe8..9792225 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -240,15 +240,15 @@ checkgroups.append((
Optional(
ListChoice(
title = _("Allowed states (otherwise check will be
critical)"),
- choices = [ ("1", _("noCard") ),
- ("2", _("noTransceiver") ),
- ("3", _("laserFault") ),
- ("4", _("noLight") ),
- ("5", _("noSync") ),
- ("6", _("inSync") ),
- ("7", _("portFault") ),
- ("8", _("diagFault") ),
- ("9", _("lockRef") ),
+ choices = [ (1, _("noCard") ),
+ (2, _("noTransceiver") ),
+ (3, _("laserFault") ),
+ (4, _("noLight") ),
+ (5, _("noSync") ),
+ (6, _("inSync") ),
+ (7, _("portFault") ),
+ (8, _("diagFault") ),
+ (9, _("lockRef") ),
]
),
title = _("Physical state of port") ,
@@ -260,11 +260,11 @@ checkgroups.append((
Optional(
ListChoice(
title = _("Allowed states (otherwise check will be
critical)"),
- choices = [ ("0", _("unknown") ),
- ("1", _("online") ),
- ("2", _("offline") ),
- ("3", _("testing") ),
- ("4", _("faulty") ),
+ choices = [ (0, _("unknown") ),
+ (1, _("online") ),
+ (2, _("offline") ),
+ (3, _("testing") ),
+ (4, _("faulty") ),
]
),
title = _("Operational state") ,
@@ -276,10 +276,10 @@ checkgroups.append((
Optional(
ListChoice(
title = _("Allowed states (otherwise check will be
critical)"),
- choices = [ ("1", _("online") ),
- ("2", _("offline") ),
- ("3", _("testing") ),
- ("4", _("faulty") ),
+ choices = [ (1, _("online") ),
+ (2, _("offline") ),
+ (3, _("testing") ),
+ (4, _("faulty") ),
]
),
title = _("Administrative state") ,