Module: check_mk
Branch: master
Commit: 87aa0ec439a23de6cff3c043fde9a3bb8b6f6906
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=87aa0ec439a23d…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Mon Sep 5 14:14:34 2016 +0200
3700 FIX FIX lparstat_aix.cpu_util usage of checkgroup parameters
The check lparstat_aix.cpu_util now supports new dictionary parameters of checkgroup,
including overall cpu utilization thresholds.
---
.werks/3700 | 11 +++++++++++
ChangeLog | 1 +
checks/lparstat_aix | 25 ++++++++++++++++++++-----
web/plugins/wato/check_parameters.py | 6 ++++--
4 files changed, 36 insertions(+), 7 deletions(-)
diff --git a/.werks/3700 b/.werks/3700
new file mode 100644
index 0000000..5a0a620
--- /dev/null
+++ b/.werks/3700
@@ -0,0 +1,11 @@
+Title: FIX lparstat_aix.cpu_util usage of checkgroup parameters
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1473074686
+
+The check lparstat_aix.cpu_util now supports new dictionary parameters of checkgroup,
including overall cpu utilization thresholds.
+
diff --git a/ChangeLog b/ChangeLog
index 61ee155..4212f10 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -371,6 +371,7 @@
* 3769 FIX: cisco_temperature: Fixed exception in case of empty SNMP data received
from device
* 3770 FIX: win_dhcp_pools: Fixed crash in case of empty DHCP pools
* 3781 FIX: ipmi: made check more robust against incomplete datasets
+ * 3700 FIX: FIX lparstat_aix.cpu_util usage of checkgroup parameters...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/lparstat_aix b/checks/lparstat_aix
index e1f6532..9fd7a8d 100644
--- a/checks/lparstat_aix
+++ b/checks/lparstat_aix
@@ -114,22 +114,37 @@ def check_lparstat_aix_cpu(_no_item, params, info):
( "system", "%.3f" % system ),
( "wait", "%.3f" % wait ) ]
+ util = user + system + wait
+
infotext = "user: %2.1f%%, system: %2.1f%%, wait: %2.1f%%" % (user, system,
wait)
# You may set a warning/critical level on the io wait
# percentage. This can be done by setting params to
# a pair of (warn, crit)
result = 0
- try:
+
+ if type(params) == tuple: # old config only levels io wait
warn, crit = params
if wait >= crit:
- result = 2
+ result = max(result, 2)
infotext += "(!!)"
elif wait >= warn:
- result = 1
+ result = max(result, 1)
infotext += "(!)"
- except:
- pass
+
+ elif type(params) == dict:
+ if 'util' in params:
+ warn, crit = params['util']
+ if util >= crit:
+ result = max(result, 2)
+ elif util >= warn:
+ result = max(result, 1)
+ if 'iowait' in params:
+ warn, crit = params['iowait']
+ if wait >= crit:
+ result = max(result, 2)
+ elif wait >= warn:
+ result = max(result, 1)
return (result, infotext, perfdata)
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 58700a4..5f28cb5 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -6788,7 +6788,8 @@ 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. "
+ "ATTENTION: This configuration cannot be used for
check <i>lparstat_aix.cpu_util</i>!")
)
),
( "core_util_graph",
@@ -6798,7 +6799,8 @@ register_check_parameters(
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.")
+ "device with very many cores. "
+ "ATTENTION: This configuration cannot be used for
check <i>lparstat_aix.cpu_util</i>!")
),
),
]