Module: check_mk
Branch: master
Commit: c09eaffd169861ccf4aff91ef04ab5de10ac4acc
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c09eaffd169861…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Jul 5 15:49:46 2018 +0200
6120 FIX cisco_nexus_cpu: use the ruleset "CPU utilization for simple devices"
Since Werk 5748 cisco_nexus_cpu is preferred over cisco_cpu on all Nexus
devices. As a result short peaks in CPU utilization might result in a WARN or
CRIT on devices that used cisco_cpu before, since the cisco_nexus_cpu check
does not deliver averaged values. To add the possibility of averaging to the
cisco_nexus_cpu check the ruleset "CPU utilization for simple devices" is now
used. With this ruleset it is possible to define arbitrary averaging periods.
The old ruleset "CPU utilization for Appliances" is not supported anymore for
the cisco_nexus_cpu check.
To accommodate for this change affected hosts have to be rediscovered and all
rules for devices that use the cisco_nexus_cpu checks have to be moved to the
new ruleset.
Change-Id: I4c97f3b81459086c32d40f9f049a04361e3a3bcd
---
.werks/6120 | 21 +++++++++++++++++++++
checkman/cisco_nexus_cpu | 3 +--
checks/cisco_nexus_cpu | 9 ++++++---
cmk/gui/plugins/wato/check_parameters.py | 22 +++++++++++-----------
4 files changed, 39 insertions(+), 16 deletions(-)
diff --git a/.werks/6120 b/.werks/6120
new file mode 100644
index 0000000..169141b
--- /dev/null
+++ b/.werks/6120
@@ -0,0 +1,21 @@
+Title: cisco_nexus_cpu: use the ruleset "CPU utilization for simple devices"
+Level: 1
+Component: checks
+Compatible: incomp
+Edition: cre
+Version: 1.6.0i1
+Date: 1530797354
+Class: fix
+
+Since Werk 5748 cisco_nexus_cpu is preferred over cisco_cpu on all Nexus
+devices. As a result short peaks in CPU utilization might result in a WARN or
+CRIT on devices that used cisco_cpu before, since the cisco_nexus_cpu check
+does not deliver averaged values. To add the possibility of averaging to the
+cisco_nexus_cpu check the ruleset "CPU utilization for simple devices" is now
+used. With this ruleset it is possible to define arbitrary averaging periods.
+The old ruleset "CPU utilization for Appliances" is not supported anymore for
+the cisco_nexus_cpu check.
+
+To accommodate for this change affected hosts have to be rediscovered and all
+rules for devices that use the cisco_nexus_cpu checks have to be moved to the
+new ruleset.
diff --git a/checkman/cisco_nexus_cpu b/checkman/cisco_nexus_cpu
index 97ceba5..9bc6087 100644
--- a/checkman/cisco_nexus_cpu
+++ b/checkman/cisco_nexus_cpu
@@ -4,8 +4,7 @@ catalog: hw/network/cisco
license: GPL
distribution: check_mk
description:
- This check monitors the CPU utilization of Cisco Nexus devices
- which do not support CPU information from CISCO-PROCESS-MIB.
+ This check monitors the CPU utilization of Cisco Nexus devices.
Default levels are 80, 90 percent. These are configurable.
diff --git a/checks/cisco_nexus_cpu b/checks/cisco_nexus_cpu
index 06822f2..957619d 100644
--- a/checks/cisco_nexus_cpu
+++ b/checks/cisco_nexus_cpu
@@ -28,12 +28,14 @@
# .1.3.6.1.4.1.9.9.305.1.1.1.0 1 --> CISCO-SYSTEM-EXT-MIB::cseSysCPUUtilization.0
-cisco_nexus_cpu_default_levels = (80.0, 90.0)
+factory_settings["cisco_nexus_cpu_default_levels"] = {
+ 'levels': (80.0, 90.0),
+}
def inventory_cisco_nexus_cpu(info):
if info[0][0]:
- return [ (None, "cisco_nexus_cpu_default_levels") ]
+ return [ (None, {}) ]
def check_cisco_nexus_cpu(_no_item, params, info):
@@ -49,6 +51,7 @@ check_info['cisco_nexus_cpu'] = {
'snmp_scan_function' : lambda oid: "cisco" in
oid(".1.3.6.1.2.1.1.1.0").lower() \
and "nx-os" in
oid(".1.3.6.1.2.1.1.1.0").lower() \
and oid(".1.3.6.1.4.1.9.9.305.1.1.1.0"),
- 'group' : "cpu_utilization",
+ 'group' : "cpu_utilization_os",
'includes' : [ "cpu_util.include" ],
+ 'default_levels_variable' : "cisco_nexus_cpu_default_levels",
}
diff --git a/cmk/gui/plugins/wato/check_parameters.py
b/cmk/gui/plugins/wato/check_parameters.py
index 8cd86ac..55778f0 100644
--- a/cmk/gui/plugins/wato/check_parameters.py
+++ b/cmk/gui/plugins/wato/check_parameters.py
@@ -9831,19 +9831,19 @@ register_check_parameters(
_("CPU utilization for simple devices"),
Dictionary(
help = _("This rule configures levels for the CPU utilization (not load) for
"
- "the operating systems Windows and VMWare ESX host systems, as well
as devices "
- "implementing the Host Resources MIB. The utilization "
- "ranges from 0 to 100 - regardless of the number of CPUs."),
+ "the operating systems Windows and VMWare ESX host systems, as well
as devices "
+ "implementing the Host Resources MIB. The utilization "
+ "ranges from 0 to 100 - regardless of the number of CPUs."),
elements = [
( "average",
- Integer(
- title = _("Averaging"),
- help = _("When this option is activated then the CPU utilization
is being "
- "averaged <b>before</b> the levels are being
applied."),
- unit = _("minutes"),
- minvalue = 1,
- default_value = 15,
- label = _("Compute average over last "),
+ Integer(
+ title = _("Averaging"),
+ help = _("When this option is activated then the CPU utilization is
being "
+ "averaged <b>before</b> the levels are being
applied."),
+ unit = _("minutes"),
+ minvalue = 1,
+ default_value = 15,
+ label = _("Compute average over last "),
)),
( "levels",
Levels(