Module: check_mk
Branch: master
Commit: ff7ba6bc77e3037b75db89a02fc00ee4b7750794
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ff7ba6bc77e303…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Thu Apr 14 14:57:47 2011 +0200
winperf_processor: added PNP template and Perf-O-Meter
---
checks/winperf_processor | 4 ++--
pnp-templates/check_mk-winperf_processor.util.php | 1 +
web/plugins/perfometer/check_mk.py | 5 +++--
3 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/checks/winperf_processor b/checks/winperf_processor
index 8093f6a..ee0bf61 100644
--- a/checks/winperf_processor
+++ b/checks/winperf_processor
@@ -55,7 +55,8 @@ def check_winperf_util(item, params, info):
used_perc = 0
elif used_perc > 100:
used_perc = 100
- perfdata = [ ("util", "%.2f" % used_perc, '',
'', 0, 100) ]
+ warn, crit = params
+ perfdata = [ ("util", "%.2f" % used_perc, warn, crit, 0,
100) ]
if num_cpus == 1:
num_txt = ""
else:
@@ -63,7 +64,6 @@ def check_winperf_util(item, params, info):
infotext = " - %d%% used%s (in last %d secs)" % (int(used_perc),
num_txt, timedif)
- warn, crit = params
if used_perc >= crit:
return (2, "CRIT" + infotext, perfdata)
elif used_perc >= warn:
diff --git a/pnp-templates/check_mk-winperf_processor.util.php
b/pnp-templates/check_mk-winperf_processor.util.php
new file mode 120000
index 0000000..07c1c09
--- /dev/null
+++ b/pnp-templates/check_mk-winperf_processor.util.php
@@ -0,0 +1 @@
+check_mk-h3c_lanswitch_cpu.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index b13c78d..068b296 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -260,7 +260,7 @@ def perfometer_oracle_sessions(row, check_command, perf_data):
perfometers["check_mk-oracle_sessions"] = perfometer_oracle_sessions
perfometers["check_mk-oracle_logswitches"] = perfometer_oracle_sessions
-def perfometer_h3c_lanswitch_cpu(row, check_command, perf_data):
+def perfometer_cpu_utilization(row, check_command, perf_data):
util = float(perf_data[0][1]) # is already percentage
warn = float(perf_data[0][3])
crit = float(perf_data[0][4])
@@ -274,7 +274,8 @@ def perfometer_h3c_lanswitch_cpu(row, check_command, perf_data):
return "%.0f%%" % util, perfometer_linear(util, color)
#perfometer_linear(perc, color)
-perfometers["check_mk-h3c_lanswitch_cpu"] = perfometer_h3c_lanswitch_cpu
+perfometers["check_mk-h3c_lanswitch_cpu"] = perfometer_cpu_utilization
+perfometers["check_mk-winperf_processor.util"] = perfometer_cpu_utilization
def perfometer_check_mk_uptime(row, check_command, perf_data):
days, rest = divmod(int(perf_data[0][1]), 60*60*24)