Module: check_mk
Branch: master
Commit: ad36bd437a1422907494d23c753d9f831d3afbe9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ad36bd437a1422…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Apr 7 09:41:00 2014 +0200
enterasys_cpu_util: Changed check to not longer summarize all modules
The check now not longer summarize the utilizations from the modules. Now each module
becomes a owne check.
If you have allrady used this check before, please to a reinventory.
---
.werks/151 | 9 +++++++++
ChangeLog | 2 ++
checkman/enterasys_cpu_util | 4 ++--
checks/enterasys_cpu_util | 22 +++++++++++-----------
4 files changed, 24 insertions(+), 13 deletions(-)
diff --git a/.werks/151 b/.werks/151
new file mode 100644
index 0000000..c93db3e
--- /dev/null
+++ b/.werks/151
@@ -0,0 +1,9 @@
+Title: enterasys_cpu_util: Changed check to not longer summarize all modules
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1396856292
+Class: incomp
+
+The check now not longer summarize the utilizations from the modules. Now each module
becomes a owne check.
+If you have allrady used this check before, please to a reinventory.
diff --git a/ChangeLog b/ChangeLog
index 04328ff..3078739 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -12,6 +12,8 @@
* 0800 ibm_svc_nodestats.cache, ibm_svc_systemstats.cache: New checks for Cache Usage
of IBM SVC / V7000 devices
* 0150 printer_suply: New option to upturn toner levels...
* 0801 ibm_svc_eventlog: New Check for Messages in Event log of IBM SVC / V7000
devices
+ * 0151 enterasys_cpu_util: Changed check to not longer summarize all modules...
+ NOTE: Please refer to the migration notes!
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed
detection
diff --git a/checkman/enterasys_cpu_util b/checkman/enterasys_cpu_util
index b8c19fe..ddccb8b 100644
--- a/checkman/enterasys_cpu_util
+++ b/checkman/enterasys_cpu_util
@@ -4,11 +4,11 @@ catalog: hw/network/enterasys
license: GPL
distribution: check_mk
description:
- This check shows the current average cpu utilization of all plugged-in CPU modules.
+ This check shows the current average cpu utilization for each plugged-in CPU modules.
inventory:
- One check will be created
+ One check per module will be created
perfdata:
The actual utilization, together with it's warn and crit levels
diff --git a/checks/enterasys_cpu_util b/checks/enterasys_cpu_util
index 94bda84..d35d41d 100644
--- a/checks/enterasys_cpu_util
+++ b/checks/enterasys_cpu_util
@@ -26,25 +26,25 @@
enterasys_cpu_default_levels = (90, 95)
def inventory_enterasys_cpu_util(info):
- return [ ( None, "enterasys_cpu_default_levels" )]
+ # [:-2] to remove the oid end
+ return [ ( x[0][:-2], "enterasys_cpu_default_levels" ) for x in info ]
-def check_enterasys_cpu_util(_no_item, params, info):
- util = 0
- for core_util in info:
- util += saveint(core_util[0]) / 10
- num_cpus = len(info)
- usage = util / num_cpus
- return check_cpu_util(usage, params)
+def check_enterasys_cpu_util( item, params, info):
+ for core, util in info:
+ if item == core[:-2]:
+ usage = saveint(util[0]) / 10
+ return check_cpu_util(usage, params)
+ return 3, "Core not found in agent Outut"
check_info["enterasys_cpu_util"] = {
"check_function" : check_enterasys_cpu_util,
"inventory_function" : inventory_enterasys_cpu_util,
- "service_description" : "CPU utilization",
- "snmp_info" : ( ".1.3.6.1.4.1.5624.1.2.49.1.1.1.1", [
3 ]), #util in last 1min
+ "service_description" : "CPU util %s",
+ "snmp_info" : ( ".1.3.6.1.4.1.5624.1.2.49.1.1.1.1", [
OID_END, 3 ]), #util in last 1min
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5624.2.1"),
"has_perfdata" : True,
- "group" : "cpu_utilization",
+ "group" : "cpu_utilization_multiitem",
"includes" : [ "cpu_util.include" ],
}