Module: check_mk
Branch: master
Commit: 3dec631de7e44a87f8daa445e0c0c9e964232f7d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3dec631de7e44a…
Author: Sven Rueß <sr(a)mathias-kettner.de>
Date: Fri Aug 19 02:22:01 2016 +0200
3842 juniper_cpu_util: Allow configuratioh of level for routing engine
---
.werks/3842 | 9 +++++++++
ChangeLog | 1 +
checks/juniper_cpu_util | 12 +++++-------
web/plugins/wato/check_parameters.py | 28 ++++++++++++++++++++++++++++
4 files changed, 43 insertions(+), 7 deletions(-)
diff --git a/.werks/3842 b/.werks/3842
new file mode 100644
index 0000000..1731ddc
--- /dev/null
+++ b/.werks/3842
@@ -0,0 +1,9 @@
+Title: juniper_cpu_util: Allow configuratioh of level for routing engine
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i1
+Date: 1471566068
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index a73df3f..1613e05 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -130,6 +130,7 @@
* 3775 fjdarye500_pfm: new check which monitors health status and lifetime of PCIe
flash modules of Eternus DX500 storage systems
* 3776 check_mail_loop: now you can specify the subject text instead of default
'Check_MK-Mail-Loop'
* 2242 fortigate_sessions, fortigate_sessions_base: Allow configuration of levels for
sessions
+ * 3842 juniper_cpu_util: Allow configuratioh of level for routing engine
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
* 3061 FIX: mk_jolokia: Fixed debugging of the agent plugin
* 3074 FIX: windows agent: fixed incorrect values for 32-bit performance counters
diff --git a/checks/juniper_cpu_util b/checks/juniper_cpu_util
index 092e889..3d1a51a 100644
--- a/checks/juniper_cpu_util
+++ b/checks/juniper_cpu_util
@@ -25,18 +25,16 @@
# Boston, MA 02110-1301 USA.
-factory_settings['juniper_cpu_util_default_levels'] = {
- 'levels': (80.0, 90.0)
-}
-
-
def inventory_juniper_cpu_util(info):
for line in info:
if "Routing Engine" in line[0]:
- yield line[0], {}
+ yield line[0], { 'levels': (80.0, 90.0) }
def check_juniper_cpu_util(item, params, info):
+ if not params:
+ params = { 'levels': (80.0, 90.0) }
+
for name, util in info:
if name == item:
return check_cpu_util(int(util), params)
@@ -45,6 +43,7 @@ def check_juniper_cpu_util(item, params, info):
check_info['juniper_cpu_util'] = {
'check_function' : check_juniper_cpu_util,
'inventory_function' : inventory_juniper_cpu_util,
+ 'group' : 'juniper_cpu_util',
'service_description' : "CPU utilization %s",
'has_perfdata' : True,
'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.2636.1.1.1.2"),
@@ -53,5 +52,4 @@ check_info['juniper_cpu_util'] = {
8, #jnxOperatingCPU
]),
'includes' : ["cpu_util.include"],
- 'default_levels_variable' : "juniper_cpu_util_default_levels"
}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 287695f..fdbb6f4 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -5443,6 +5443,34 @@ register_check_parameters(
register_check_parameters(
subgroup_os,
+ "juniper_cpu_util",
+ _("Juniper Processor Utilization of Routing Engine"),
+ Transform(
+ Dictionary(
+ help = _("CPU utilization of routing engine."),
+ optional_keys = [],
+ elements = [
+ ("levels",
+ Tuple(
+ title = _("Specify levels in percentage of processor routing
engine usage"),
+ elements = [
+ Percentage(title = _("Warning at"), default_value =
80.0),
+ Percentage(title = _("Critical at"), default_value
= 90.0),
+ ],
+ ),
+ ),
+ ]
+ ),
+ forth = lambda old: not old and { 'levels': (80.0, 90.0) } or old,
+ ),
+ TextAscii(
+ title = _("Routing Engine"),
+ ),
+ "dict",
+)
+
+register_check_parameters(
+ subgroup_os,
"netscaler_mem",
_("Netscaler Memory Usage"),
Tuple(