Module: check_mk
Branch: master
Commit: 00982cb9b6749720f399a6fdffca1860ae8bce59
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=00982cb9b67497…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jul 28 10:44:26 2015 +0200
#2497 FIX veeam_client: Fixed exception when client is missing in agent output
---
.werks/2497 | 10 ++++++++++
ChangeLog | 1 +
checks/veeam_client | 10 ++++++----
3 files changed, 17 insertions(+), 4 deletions(-)
diff --git a/.werks/2497 b/.werks/2497
new file mode 100644
index 0000000..77c9118
--- /dev/null
+++ b/.werks/2497
@@ -0,0 +1,10 @@
+Title: veeam_client: Fixed exception when client is missing in agent output
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1438073041
+
+
diff --git a/ChangeLog b/ChangeLog
index edf312f..86607c8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -82,6 +82,7 @@
* 2494 FIX: Clasic SNMP mode now uses normal snmpwalk when bulkwalks are disabled
with SNMPv3
* 2495 FIX: printer_supply: Fixed exception when unit type is not available via SNMP
* 2496 FIX: Fixed CPU load checks when monitoring raspbian/babanian systems
+ * 2497 FIX: veeam_client: Fixed exception when client is missing in agent output
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/veeam_client b/checks/veeam_client
index e84fd8f..a240b17 100644
--- a/checks/veeam_client
+++ b/checks/veeam_client
@@ -55,11 +55,13 @@ def inventory_veeam_client(parsed):
def check_veeam_client(item, params, parsed):
# Fallback for old None item version
#FIXME Can be remvoed in CMK 2.0
- if item == None:
- key = parsed.keys()[0]
- data = parsed[key]
- else:
+ if item == None and len(parsed) > 0:
+ item = parsed.keys()[0]
+
+ try:
data = parsed[item]
+ except KeyError:
+ return 3, "Client not found in agent output"
perfdata = []
infotexts = []