Module: check_mk
Branch: master
Commit: d39e5853c3192da85db784938adfeabe6f81c4da
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d39e5853c3192d…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Oct 25 17:06:19 2016 +0200
3831 FIX ucd_cpu_util: no longer reports an UNKNOWN error when the counter data wasn't
updated
The check now raises an MKCounterWrapped instead.
This means that the check might go stale, when the data no longer updates.
---
.werks/3831 | 11 +++++++++++
ChangeLog | 1 +
checks/ucd_cpu_util | 2 +-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/3831 b/.werks/3831
new file mode 100644
index 0000000..732a8fc
--- /dev/null
+++ b/.werks/3831
@@ -0,0 +1,11 @@
+Title: ucd_cpu_util: no longer reports an UNKNOWN error when the counter data wasn't
updated
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i2
+Date: 1477407867
+Class: fix
+
+The check now raises an MKCounterWrapped instead.
+This means that the check might go stale, when the data no longer updates.
+
diff --git a/ChangeLog b/ChangeLog
index 2e265af..99234fd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,7 @@
* 3966 FIX: apc_symmetra raritan_emx: Fixed wrong include
"temperature.includes"...
* 3829 FIX: Skype for Business checks: refactored most of the checks...
* 3961 FIX: fixed error sections handling if parse function is available
+ * 3831 FIX: ucd_cpu_util: no longer reports an UNKNOWN error when the counter data
wasn't updated...
Multisite:
* 3959 Two new filters for the comment view: author and comment text field
diff --git a/checks/ucd_cpu_util b/checks/ucd_cpu_util
index bd17d85..591c553 100644
--- a/checks/ucd_cpu_util
+++ b/checks/ucd_cpu_util
@@ -53,7 +53,7 @@ def check_ucd_cpu_util(item, params, info):
total = sum(rates)
if total == 0:
- return (3, "counters have not moved since last check, looks like state fake
data")
+ raise MKCounterWrapped("Rates have not changed since last interval")
parts = [ r/total for r in rates ]
user = 100 * (parts[0] + parts[1])