[checkmk-commits] Check_MK Git: check_mk: cpu.loads: nicer display of number of core in graph

Mathias Kettner mk at mathias-kettner.de
Sat Feb 7 10:08:49 CET 2015


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

Author: Mathias Kettner <mk at mathias-kettner.de>
Date:   Sat Feb  7 10:08:42 2015 +0100

cpu.loads: nicer display of number of core in graph

---

 pnp-templates/check_mk-cpu.loads.php |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/pnp-templates/check_mk-cpu.loads.php b/pnp-templates/check_mk-cpu.loads.php
index a52ba70..ba42403 100644
--- a/pnp-templates/check_mk-cpu.loads.php
+++ b/pnp-templates/check_mk-cpu.loads.php
@@ -35,7 +35,12 @@ foreach ($NAME as $i => $n) {
     $MAX[$n]  = $MAX[$i];
 }
 
-$opt[1] = "--vertical-label 'Load average' -l0  -u 1 --title \"CPU Load for $hostname\" ";
+$title = "CPU Load for $hostname";
+if ($MAX[1]) {
+    $title .= " - $MAX[1] CPU Cores";
+}
+
+$opt[1] = "--vertical-label 'Load average' -l0  -u 1 --title \"$title\" ";
 
 $def[1] =  ""
          . "DEF:load1=$RRD[load1] "
@@ -58,9 +63,6 @@ if ($WARN[1]) {
          . "";
 }
 
-if ($MAX[1]) {
-    $def[1] .= "COMMENT:\" Number of CPUs $MAX[1]\" ";
-}
 
 if (isset($RRD["predict_load15"])) {
     $def[1] .= ""



More information about the checkmk-commits mailing list