Module: check_mk
Branch: master
Commit: a9575c5505e48d9bec40df8d874677f1a50b19a3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a9575c5505e48d…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Jul 13 10:11:14 2017 +0200
4971 FIX cups_queues: Fixed crash if agent output is empty or item not found
Change-Id: Ic376f1cac673cd286b393f8d33751c5ca07e9c3f
---
.werks/4971 | 10 ++++++++++
checks/cups_queues | 4 ++++
2 files changed, 14 insertions(+)
diff --git a/.werks/4971 b/.werks/4971
new file mode 100644
index 0000000..42353d3
--- /dev/null
+++ b/.werks/4971
@@ -0,0 +1,10 @@
+Title: cups_queues: Fixed crash if agent output is empty or item not found
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1499933436
+Class: fix
+
+
diff --git a/checks/cups_queues b/checks/cups_queues
index 972abcb..795844d 100644
--- a/checks/cups_queues
+++ b/checks/cups_queues
@@ -96,6 +96,10 @@ def inventory_cups_queues(parsed):
yield item, {}
def check_cups_queues(item, params, parsed):
+ if item not in parsed:
+ yield 3, "Item not found in agent data"
+ return
+
data = parsed[item]
if type(params) == tuple and len(params) == 4:
params = {"job_count" : (params[0], params[1]),