Module: check_mk
Branch: master
Commit: 944372e366618df5b5d4f3780c1d932d44586a6c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=944372e366618d…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Thu Oct 18 09:33:57 2018 +0200
6807 FIX veeam_tapejobs: Check returns 'Item not found' if no jobs are sent by the
agent
Change-Id: I9ec39c0ededacf92f1a5de776ad258a5d7f0ffdf
---
.werks/6807 | 11 +++++++++++
checks/veeam_tapejobs | 8 ++++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/6807 b/.werks/6807
new file mode 100644
index 0000000..9cffec8
--- /dev/null
+++ b/.werks/6807
@@ -0,0 +1,11 @@
+Title: veeam_tapejobs: Check returns 'Item not found' if no jobs are sent by the
agent
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1539848025
+
+
diff --git a/checks/veeam_tapejobs b/checks/veeam_tapejobs
index 68c0008..c3f17c9 100644
--- a/checks/veeam_tapejobs
+++ b/checks/veeam_tapejobs
@@ -48,8 +48,12 @@ def inventory_veeam_tapejobs(parsed):
def check_veeam_tapejobs(item, params, parsed):
- last_result = parsed[item]["last_result"]
- last_state = parsed[item]["last_state"]
+ data = parsed.get(item)
+ if data is None:
+ return
+
+ last_result = data["last_result"]
+ last_state = data["last_state"]
statetext = ", last state: " + last_state
warn, crit = params