Module: check_mk
Branch: master
Commit: b43d54e5124b61ce42a88f4bd5950f207fe6975c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b43d54e5124b61…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jan 22 09:56:39 2013 +0100
FIX: drbd: Parameters for expected roles and disk states can now be set to None to disable
alerting on changed values
---
ChangeLog | 2 ++
checks/drbd | 4 ++--
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index ce3decf..5c923e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
Checks & Agents:
* FIX: mssql_counters.file_sizes - Fixed wrong value for "Log Files" in
output
+ * FIX: drbd: Parameters for expected roles and disk states can now be set to
+ None to disable alerting on changed values
WATO:
* Added hr_mem check to the memory checkgroup to make it configurable in WATO
diff --git a/checks/drbd b/checks/drbd
index 4c58dc8..76b067c 100644
--- a/checks/drbd
+++ b/checks/drbd
@@ -254,12 +254,12 @@ def check_drbd_general(item, params, info):
output = 'Connection State: %s' % parsed['cs']
output += ', Roles: %s/%s' % (parsed['ro'][0],
parsed['ro'][1])
- if parsed['ro'] != params[0]:
+ if params[0] is not None and parsed['ro'] != params[0]:
state = state < 2 and 2 or state
output += ' (Expected: %s/%s)' % (params[0][0], params[0][1])
output += ', Disk States: %s/%s' % (parsed['ds'][0],
parsed['ds'][1])
- if parsed['ds'] != params[1]:
+ if params[1] is not None and parsed['ds'] != params[1]:
state = state < 2 and 2 or state
output += ' (Expected: %s/%s)' % (params[1][0], params[1][1])