Module: check_mk
Branch: master
Commit: b164dc880f424931038e6c66369b8e206a071e36
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b164dc880f4249…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Jan 15 11:25:38 2016 +0100
#2920 hr_cpu: this check can now also display per-core graphs
per-core graphs are optional and have to be enabled through the rule "CPU utilization
for simple
devices"
---
.werks/2920 | 10 ++++++++++
ChangeLog | 1 +
checks/hr_cpu | 7 +++++--
web/plugins/wato/check_parameters.py | 5 +++--
4 files changed, 19 insertions(+), 4 deletions(-)
diff --git a/.werks/2920 b/.werks/2920
new file mode 100644
index 0000000..14299e8
--- /dev/null
+++ b/.werks/2920
@@ -0,0 +1,10 @@
+Title: hr_cpu: this check can now also display per-core graphs
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1452853469
+Class: feature
+
+per-core graphs are optional and have to be enabled through the rule "CPU
utilization for simple
+devices"
diff --git a/ChangeLog b/ChangeLog
index b55f708..d142bd1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,6 +81,7 @@
* 2890 cisco_nexus_cpu, cisco_oldcpu: new checks for Cisco devices which do not
support CPU utilization information from CISCO PROCESS MIB
* 2918 agent_jolokia: jolokia can now be monitored using a special agent
* 2919 hp_webmgmt_status: New check for health status of various Hewlett-Packard
devices...
+ * 2920 hr_cpu: this check can now also display per-core graphs...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checks/hr_cpu b/checks/hr_cpu
index f327b66..3d26fa4 100644
--- a/checks/hr_cpu
+++ b/checks/hr_cpu
@@ -32,13 +32,16 @@ def inventory_hr_cpu(info):
def check_hr_cpu(_no_item, params, info):
num_cpus = 0
util = 0
+ cores = []
for line in info:
- util += int(line[0])
+ core_util = int(line[0])
+ cores.append(("core%d" % num_cpus, core_util))
+ util += core_util
num_cpus += 1
if num_cpus == 0:
return 3, "No data found in SNMP output"
util = float(util) / num_cpus
- return check_cpu_util(util, params)
+ return check_cpu_util(util, params, cores=cores)
# HOST-RESOURCES-MIB::hrSystemUptime.0
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 89ae8bd..9d3c400 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -4709,13 +4709,14 @@ register_check_parameters(
),
( "core_util_graph",
Checkbox(
- title = _("Graphs for individual cores (windows only)"),
+ title = _("Graphs for individual cores"),
label = _("Enable performance graph for utilization of
individual cores"),
help = _("This adds another graph to the performance CPU
utilization "
"details page, showing utilization of individual cores.
"
"Please note that this graph may be impractical on
"
"device with very many cores. "
- "This is currently only supported on windows.")
+ "This is currently only supported on linux and windows
agents "
+ "as well as devices monitored through the host-resource
mib")
),
),
]