Module: check_mk
Branch: master
Commit: e7769b23128faf07bec1d4e013e984e380aa5443
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e7769b23128faf…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 2 11:26:35 2015 +0100
#2850 FIX juniper_cpu: Better error handling of empty data reported by device
---
.werks/2850 | 10 ++++++++++
ChangeLog | 1 +
checks/juniper_cpu | 6 +++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/2850 b/.werks/2850
new file mode 100644
index 0000000..ac18688
--- /dev/null
+++ b/.werks/2850
@@ -0,0 +1,10 @@
+Title: juniper_cpu: Better error handling of empty data reported by device
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i4
+Date: 1449051972
+
+
diff --git a/ChangeLog b/ChangeLog
index c425e9a..ea9b43f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -115,6 +115,7 @@
* 2842 FIX: jolokia_metrics.perm_gen: fixed wrong calculation of perf variables warn
and crit
* 2782 FIX: cups_queues: fix crash in case user name contains spaces
* 2849 FIX: winperf_processor.util: Fixed crash in case no CPU infos are sent
+ * 2850 FIX: juniper_cpu: Better error handling of empty data reported by device
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/juniper_cpu b/checks/juniper_cpu
index 5278430..cf05d91 100644
--- a/checks/juniper_cpu
+++ b/checks/juniper_cpu
@@ -32,7 +32,11 @@ def inventory_juniper_cpu(info):
def check_juniper_cpu(item, params, info):
for line in info:
if line[0] == item:
- util1, util5, util15 = map(int, line[1:])
+ try:
+ util1, util5, util15 = map(int, line[1:])
+ except ValueError:
+ return 3, "CPU information not provided by device"
+
warn, crit = params
label1, label5, label15 = "", "", ""
state = 0