Module: check_mk
Branch: master
Commit: 80ac03324b09820303d28eed547b05b0960859a2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=80ac03324b0982…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Jun 1 10:45:20 2015 +0200
sni_octopuse_cpu: formalize for new graph system
---
checks/sni_octopuse_cpu | 16 +++-------------
pnp-templates/check_mk-sni_octopuse_cpu.php | 1 -
web/plugins/metrics/check_mk.py | 2 ++
3 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/checks/sni_octopuse_cpu b/checks/sni_octopuse_cpu
index cb7b6e3..ae358b4 100644
--- a/checks/sni_octopuse_cpu
+++ b/checks/sni_octopuse_cpu
@@ -25,25 +25,15 @@
# Boston, MA 02110-1301 USA.
-#1.3.6.1.4.1.231.7.2.9.1.7
-#CPU util
-#( 0..100 )
-
def inventory_octopus_cpu(info):
- # are there only 1-cpu models?
if len(info[0][0]) == 1:
- # no level so far, it should work ok even under load
return [(None, None)]
def check_octopus_cpu(_no_item, _no_params_info, info):
- try:
- # need to un-triple pack here.
- cpu_perc = int(info[0][0][0])
- perfdata = [ ("util", "%.3f" % cpu_perc) ]
- return (0, "CPU utilization is %d%%. (OK from 0-100)" % cpu_perc,
perfdata)
- except:
- return (3, "UKNW - invalid data received")
+ cpu_perc = int(info[0][0][0])
+ perfdata = [ ("util", "%.3f" % cpu_perc) ]
+ return 0, "CPU utilization is %d%%" % cpu_perc, perfdata
check_info['sni_octopuse_cpu'] = {
diff --git a/pnp-templates/check_mk-sni_octopuse_cpu.php
b/pnp-templates/check_mk-sni_octopuse_cpu.php
deleted file mode 120000
index aa15f0d..0000000
--- a/pnp-templates/check_mk-sni_octopuse_cpu.php
+++ /dev/null
@@ -1 +0,0 @@
-check_mk-winperf.cpuusage.php
\ No newline at end of file
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 92608cd..4c794e7 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -1284,6 +1284,7 @@ check_metrics["check_mk-ucd_cpu_util"]
= { "wait" : { "
check_metrics["check_mk-vms_cpu"] = {
"wait" : { "name" : "io_wait" } }
check_metrics["check_mk-vms_sys.util"] = {
"wait" : { "name" : "io_wait" } }
check_metrics["check_mk-winperf.cpuusage"] = {
"cpuusage" : { "name" : "util" } }
+check_metrics["check_mk-sni_octopuse_cpu"] = {}
check_metrics["check_mk-mbg_lantime_state"] = {
"offset" : { "name" : "time_offset", "scale" :
0.000001 }} # convert us -> sec
check_metrics["check_mk-mbg_lantime_ng_state"] = {
"offset" : { "name" : "time_offset", "scale" :
0.000001 }} # convert us -> sec
@@ -1531,6 +1532,7 @@ perfometer_info.append({
"exponent" : 2,
})
+# TODO: :max should be the default?
perfometer_info.append(("linear", ( [ "used_dhcp_leases" ],
"used_dhcp_leases:max", None)))
perfometer_info.append(("stacked", [