[checkmk-commits] 6650 FIX winperf_processor.util predictive levels retrieval

Óscar Nájera on at mathias-kettner.de
Wed Nov 21 09:51:07 CET 2018


Module: check_mk
Branch: master
Commit: f146a72c4d47ee7a68ea48b21ab1d89a1f81ec0c
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f146a72c4d47ee7a68ea48b21ab1d89a1f81ec0c

Author: Óscar Nájera <on at mathias-kettner.de>
Date:   Mon Nov 19 18:55:40 2018 +0100

6650 FIX winperf_processor.util predictive levels retrieval

Werk 6126 changed the metric name(performance data value) but missed
changing this name in the variable for retrieval of data to generate the
predictive levels.

If retrieval of rrd is gives a response but without data, then exception is
raised too.

Change-Id: I5bfc24bdd0ace8b1b6c0235ef2a724957c289a9c

---

 .werks/6650             | 16 ++++++++++++++++
 checks/cpu_util.include |  2 +-
 cmk_base/prediction.py  |  2 +-
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/.werks/6650 b/.werks/6650
new file mode 100644
index 0000000..f7d4270
--- /dev/null
+++ b/.werks/6650
@@ -0,0 +1,16 @@
+Title: winperf_processor.util predictive levels retrieval
+Level: 1
+Component: checks
+Compatible: compat
+Edition: cre
+Version: 1.5.0p8
+Date: 1542729817
+Class: fix
+
+Werk 6126 changed the metric name(performance data value) but missed
+changing this name in the variable for retrieval of data to generate the
+predictive levels.
+
+If retrieval of rrd is gives a response but without data, then exception is
+raised too.
+
diff --git a/checks/cpu_util.include b/checks/cpu_util.include
index 919a52d..30090ae 100644
--- a/checks/cpu_util.include
+++ b/checks/cpu_util.include
@@ -69,7 +69,7 @@ def check_cpu_util(util, params, this_time=None, cores=None):
     if "average" in params:
         util_avg = get_average("cpu_utilization.avg", this_time, util, params["average"])
         check_against = util_avg
-        perfvar = "avg"
+        perfvar = "util_average"
         infotext += ", %dmin average: %.1f%%" % (params["average"], util_avg)
     else:
         check_against = util
diff --git a/cmk_base/prediction.py b/cmk_base/prediction.py
index cba43f1..13bba2b 100644
--- a/cmk_base/prediction.py
+++ b/cmk_base/prediction.py
@@ -65,7 +65,7 @@ def get_rrd_data(hostname, service_description, varname, cf, fromtime, untiltime
             raise
         raise MKGeneralException("Cannot get historic metrics via Livestatus: %s" % e)
 
-    if not response:
+    if not response or not response[3:]:
         raise MKGeneralException("Got no historic metrics")
 
     step, values = response[2], response[3:]



More information about the checkmk-commits mailing list