Module: check_mk
Branch: master
Commit: aa65469d9def298bae6f3a1d37078f964b22b20f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aa65469d9def29…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Mar 25 09:17:44 2015 +0100
siemens_plc: Fixed decreased counters not recovering
---
checks/siemens_plc | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/checks/siemens_plc b/checks/siemens_plc
index 913e4ea..db8dad6 100644
--- a/checks/siemens_plc
+++ b/checks/siemens_plc
@@ -146,9 +146,11 @@ def check_siemens_plc_duration(item, params, info):
key = 'siemens_plc.duration.%s' % item
if key in g_counters and g_counters[key] < seconds:
+ g_counters[key] = seconds
return 2, 'Reduced from %s to %s' %
(get_age_human_readable(g_counters[key]),
get_age_human_readable(seconds))
- g_counters[key] = seconds
+ else:
+ g_counters[key] = seconds
state = 0
warn, crit = params.get('duration', (None, None))
@@ -191,8 +193,10 @@ def check_siemens_plc_counter(item, params, info):
key = 'siemens_plc.counter.%s' % item
if key in g_counters and g_counters[key] < value:
+ g_counters[key] = value
return 2, 'Reduced from %s to %s' % (g_counters[key], value)
- g_counters[key] = value
+ else:
+ g_counters[key] = value
state = 0
warn, crit = params.get('levels', (None, None))