Module: check_mk
Branch: master
Commit: 79f191cf850faa194496d0ed060bbb3951f03ebd
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=79f191cf850faa…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Apr 4 10:11:18 2014 +0200
ibm_svc_systemstats.cpu_util: New check for CPU Utilization of an IBM SVC / V7000 device
in total
---
.werks/799 | 8 ++++
ChangeLog | 5 ++-
checkman/ibm_svc_systemstats.cpu_util | 38 +++++++++++++++++
checks/ibm_svc_systemstats | 45 ++++++++++++++++++++
.../check_mk-ibm_svc_systemstats.cpu_util.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
6 files changed, 96 insertions(+), 2 deletions(-)
diff --git a/.werks/799 b/.werks/799
new file mode 100644
index 0000000..2791f15
--- /dev/null
+++ b/.werks/799
@@ -0,0 +1,8 @@
+Title: ibm_svc_systemstats.cpu_util: New check for CPU Utilization of an IBM SVC / V7000
device in total
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1396599037
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index a717f44..39bded3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,10 +1,11 @@
1.2.5i3:
Checks & Agents:
- * 0601 printer_alerts: check can now display a textual representation of the alert
code...
- NOTE: Please refer to the migration notes!
* 0149 cisco_secure: New check for Port Security on Cisco swichtes
* 0751 New localcheck for Linux that makes sure that filesystems in /etc/fstab are
mounted...
* 0783 enterasys_lsnat: new check monitoring the current LSNAT bindings
+ * 0601 printer_alerts: check can now display a textual representation of the alert
code...
+ NOTE: Please refer to the migration notes!
+ * 0799 ibm_svc_systemstats.cpu_util: New check for CPU Utilization of an IBM SVC /
V7000 device in total
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
Multisite:
diff --git a/checkman/ibm_svc_systemstats.cpu_util
b/checkman/ibm_svc_systemstats.cpu_util
new file mode 100644
index 0000000..3a572fd
--- /dev/null
+++ b/checkman/ibm_svc_systemstats.cpu_util
@@ -0,0 +1,38 @@
+title: IBM SVC / V7000: CPU Utilization in Total
+agents: ibm_svc
+catalog: hw/storagehw/ibm
+license: GPL
+distribution: check_mk
+description:
+ Reports the CPU Utilization of an IBM SVC / V7000 device in total.
+
+ The check returns {WARN} or {CRIT} if the utilization in percent is higher
+ then given levels and {OK} otherwise.
+
+inventory:
+ Creates one check IBM SVC / V7000 device.
+
+perfdata:
+ One value: The utilization in percent, together with it's levels for
+ warn and crit.
+
+examples:
+ # set default levels to 70 and 80 percent:
+ ibm_svc_cpu_default_levels = (70.0, 80.0)
+
+ # Check CPU Utilization on a IBM SVC called my-svc with default levels
+ checks += [
+ ("my-svc", "ibm_svc_nodestats.cpu_util", None,
ibm_svc_cpu_default_levels)
+ ]
+
+ # or use individual levels for warn and crit
+ checks += [
+ ("my-svc", "ibm_svc_nodestats.cpu_util", None, (75.0, 85.0))
+ ]
+
+[parameters]
+parameters (float, float): levels of CPU utilization for {WARN} and {CRIT} in percent
+
+[configuration]
+ibm_svc_cpu_default_levels (float, float): The standard levels for {WARN} and
+ {CRIT}, preset to (80.0, 90.0)
diff --git a/checks/ibm_svc_systemstats b/checks/ibm_svc_systemstats
index 13a0ceb..c6f3db0 100644
--- a/checks/ibm_svc_systemstats
+++ b/checks/ibm_svc_systemstats
@@ -64,6 +64,14 @@
# drive_w_io:0:0:140325134929
# drive_w_ms:0:0:140325134929
+# .--disk IO-------------------------------------------------------------.
+# | _ _ _ ___ ___ |
+# | __| (_)___| | __ |_ _/ _ \ |
+# | / _` | / __| |/ / | | | | | |
+# | | (_| | \__ \ < | | |_| | |
+# | \__,_|_|___/_|\_\ |___\___/ |
+# | |
+# '----------------------------------------------------------------------'
# parses agent output into a structure like:
# {'Drives': {'r_mb': 0, 'w_mb': 0},
@@ -118,3 +126,40 @@ check_info["ibm_svc_systemstats.diskio"] = {
"has_perfdata" : True,
}
+#.
+# .--cpu-----------------------------------------------------------------.
+# | |
+# | ___ _ __ _ _ |
+# | / __| '_ \| | | | |
+# | | (__| |_) | |_| | |
+# | \___| .__/ \__,_| |
+# | |_| |
+# | |
+# '----------------------------------------------------------------------'
+
+ibm_svc_cpu_default_levels = ( 90.0, 95.0 )
+
+def inventory_ibm_svc_systemstats_cpu(info):
+ inventory = []
+ for stat_name, stat_current, stat_peak, stat_peak_time in info:
+ if stat_name == "cpu_pc":
+ inventory.append( (None, "ibm_svc_cpu_default_levels") )
+ return inventory
+
+def check_ibm_svc_systemstats_cpu(item, params, info):
+ for stat_name, stat_current, stat_peak, stat_peak_time in info:
+ if stat_name == "cpu_pc":
+ return check_cpu_util(int(stat_current), params)
+
+ return 3, "value cpu_pc not found in agent output for node %s" % item
+
+check_info["ibm_svc_systemstats.cpu_util"] = {
+ "check_function" : check_ibm_svc_systemstats_cpu,
+ "inventory_function" : inventory_ibm_svc_systemstats_cpu,
+ "service_description" : "CPU utilization Total",
+ "has_perfdata" : True,
+ "group" : "cpu_utilization",
+ "includes" : [ "cpu_util.include" ],
+}
+#.
+
diff --git a/pnp-templates/check_mk-ibm_svc_systemstats.cpu_util.php
b/pnp-templates/check_mk-ibm_svc_systemstats.cpu_util.php
new file mode 120000
index 0000000..685ccd3
--- /dev/null
+++ b/pnp-templates/check_mk-ibm_svc_systemstats.cpu_util.php
@@ -0,0 +1 @@
+check_mk-ibm_svc_nodestats.cpu_util.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 34f643a..fe321c4 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -476,6 +476,7 @@ perfometers["check_mk-innovaphone_cpu"] =
perfometer_cpu_utilization
perfometers["check_mk-enterasys_cpu_util"] = perfometer_cpu_utilization
perfometers["check_mk-juniper_trpz_cpu_util"] = perfometer_cpu_utilization
perfometers["check_mk-ibm_svc_nodestats.cpu_util"] =
perfometer_cpu_utilization
+perfometers["check_mk-ibm_svc_systemstats.cpu_util"] =
perfometer_cpu_utilization
def perfometer_ps_perf(row, check_command, perf_data):
perf_dict = dict([(p[0], float(p[1])) for p in perf_data])