Module: check_mk
Branch: master
Commit: e06f7fe3e568022c094e15274ee2f7584b37b91f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e06f7fe3e56802…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Jan 15 11:46:39 2016 +0100
updated werk 2920 and related documentation
---
.werks/2920 | 6 +++---
ChangeLog | 2 +-
web/plugins/wato/check_parameters.py | 6 ++++--
3 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/.werks/2920 b/.werks/2920
index 14299e8..df5cd2e 100644
--- a/.werks/2920
+++ b/.werks/2920
@@ -1,4 +1,4 @@
-Title: hr_cpu: this check can now also display per-core graphs
+Title: hr_cpu: this check can now also supports per-core features
Level: 1
Component: checks
Compatible: compat
@@ -6,5 +6,5 @@ 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"
+per-core graphs and alerts on high single-core load are optional features
+that have to be enabled through the rule "CPU utilization for simple devices"
diff --git a/ChangeLog b/ChangeLog
index d142bd1..b9a65ac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -81,7 +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...
+ * 2920 hr_cpu: this check can now also supports per-core features...
* 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/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 9d3c400..337f235 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -4695,7 +4695,7 @@ register_check_parameters(
( "core_util_time",
Tuple(
title = _("Alert on high utilization over an extended time period on a single "
- "core (windows only)"),
+ "core"),
elements = [
Percentage(title = _("High utilization at "), default_value = 100.0),
Age(title = _("Warning after "), default_value = 5 * 60),
@@ -4704,7 +4704,9 @@ register_check_parameters(
help = _("A single thread fully utilizing a single core (potentially due to a bug) "
"may go unnoticed when only monitoring the total utilization of the CPU. "
"With this configuration, check_mk will alert if a single core is "
- "exceeding a utilization threshold over an extended period of time.")
+ "exceeding a utilization threshold over an extended period of time."
+ "This is currently only supported on linux and windows agents "
+ "as well as devices monitored through the host-resource mib")
)
),
( "core_util_graph",
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")
),
),
]
Module: check_mk
Branch: master
Commit: 6d5a494780cc76325131844f4d7a7bdf350e39fb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=6d5a494780cc76…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Fri Jan 15 09:46:05 2016 +0100
#2919 hp_webmgmt_status: New check for health status of various Hewlett-Packard devices
This check supports different device types but apparently not all models. Among the supported devices are some
switches and tape libraries of the storever series.
---
.werks/2919 | 10 ++++++++
ChangeLog | 1 +
checkman/hp_webmgmt_status | 18 ++++++++++++++
checks/hp_webmgmt_status | 58 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 87 insertions(+)
diff --git a/.werks/2919 b/.werks/2919
new file mode 100644
index 0000000..5a940e3
--- /dev/null
+++ b/.werks/2919
@@ -0,0 +1,10 @@
+Title: hp_webmgmt_status: New check for health status of various Hewlett-Packard devices
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1452847397
+Class: feature
+
+This check supports different device types but apparently not all models. Among the supported devices are some
+switches and tape libraries of the storever series.
diff --git a/ChangeLog b/ChangeLog
index 4c63f18..b55f708 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -80,6 +80,7 @@
* 2916 checkpoint_fan, checkpoint_firewall, checkpoint_ha_problems, checkpoint_ha_status, checkpoint_powersupply, checkpoint_svn_status, checkpoint_temp, checkpoint_voltage: New checks for various aspects of checkpoint firewalls
* 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...
* 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/checkman/hp_webmgmt_status b/checkman/hp_webmgmt_status
new file mode 100644
index 0000000..eecc07d
--- /dev/null
+++ b/checkman/hp_webmgmt_status
@@ -0,0 +1,18 @@
+title: HP Web Management: Status
+agents: snmp
+catalog: hw/network/hp
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the overall health status of various HP devices.
+
+ The check status is directly relayed from the device, with both "critical"
+ and "non-recoverable" device statuses translating to {CRIT}
+
+ It's not entirely clear which devices are covered by the check but it does
+ support some switches and tape libraries of the storever series.
+ It's possible support for the used mib is configurable in the device.
+
+inventory:
+ One service per management object is discovered, usually one.
+
diff --git a/checks/hp_webmgmt_status b/checks/hp_webmgmt_status
new file mode 100644
index 0000000..e9906dc
--- /dev/null
+++ b/checks/hp_webmgmt_status
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2016 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+
+
+def inventory_hp_webmgmt_status(info):
+ for index, health in info:
+ yield index, None
+
+
+def check_hp_webmgmt_status(item, _no_params, info):
+ status_map = {
+ "1": (3, "unknown"),
+ "2": (3, "unused"),
+ "3": (0, "ok"),
+ "4": (1, "warning"),
+ "5": (2, "critical"),
+ "6": (2, "non-recoverable")
+ }
+ for index, health in info:
+ if index == item:
+ status, status_msg = status_map[health]
+ return status, "Device status: %s" % status_msg
+
+
+check_info['hp_webmgmt_status'] = {
+ 'check_function' : check_hp_webmgmt_status,
+ 'inventory_function' : inventory_hp_webmgmt_status,
+ 'service_description' : "Status %s",
+ 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.11")\
+ and oid(".1.3.6.1.4.1.11.2.36.1.1.5.1.1.1"),
+ 'snmp_info' : ('.1.3.6.1.4.1.11.2.36.1.1.5.1.1', [1, # hpHttpMgDeviceIndex
+ 3 # hpHttpMgDeviceHealth
+ ]),
+}
+