Module: check_mk
Branch: master
Commit: 029fd82394cca3c57ea14ee37baeccd10cc8295f
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=029fd82394cca3…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Oct 1 14:33:33 2012 +0200
FIX: printer_alerts, printer_alerts_text_map wasn't clean integrated
---
checks/printer_alerts | 13 +++++++------
1 files changed, 7 insertions(+), 6 deletions(-)
diff --git a/checks/printer_alerts b/checks/printer_alerts
index 486eb05..07ece85 100644
--- a/checks/printer_alerts
+++ b/checks/printer_alerts
@@ -93,9 +93,10 @@ def check_printer_alerts(_not_used, _not_used1, info):
state = 3 # UNKNOWN
if desc in printer_alerts_text_map:
- state = printer_alerts_text_map[desc]
- sum_txt.append("%s - %s" % (nagios_state_names[state], desc))
- break
+ sum_state = max(printer_alerts_text_map[desc], sum_state)
+ #sum_txt.append("%s - %s" % (nagios_state_names[state], desc))
+ continue
+
code = saveint(code)
for s in [ 2, 1, 0 ]:
if code in printer_alerts_state_map[s]:
@@ -111,11 +112,11 @@ def check_printer_alerts(_not_used, _not_used1, info):
group_txt += ' #%s' % group_index
if state == 2:
- sum_state = 2
+ sum_state = max(2, sum_state)
elif state == 3 and sum_state != 2:
- sum_state = 3
+ sum_state = max(3, sum_state)
elif state > sum_state:
- sum_state = state
+ sum_state = max(state, sum_state)
info_text = '%s - %s - %s' % (nagios_state_names[state], group_txt,
desc)
if state == 3 and code != -1: