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>!")
),
),
]
Module: check_mk
Branch: master
Commit: 33a8625476f7d71c10930a438d1b28f5d0f02017
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=33a8625476f7d7…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Sep 5 11:58:05 2016 +0200
Fixed broken mail option: Information to be displayed in email body
---
notifications/mail | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/notifications/mail b/notifications/mail
index 817a368..6b3e7fe 100755
--- a/notifications/mail
+++ b/notifications/mail
@@ -694,8 +694,10 @@ def render_performance_graphs(context):
def construct_content(context):
# A list of optional information is configurable via the parameter "elements"
# (new configuration style)
- if "PARAMETER_ELEMENTS" in context:
- elements = context["PARAMETER_ELEMENTS"].split()
+ # Note: The value PARAMETER_ELEMENTSS is NO TYPO.
+ # Have a look at the function events.py:add_to_event_context(..)
+ if "PARAMETER_ELEMENTSS" in context:
+ elements = context["PARAMETER_ELEMENTSS"].split()
else:
elements = [ "perfdata", "graph", "abstime", "address", "longoutput" ]
Module: check_mk
Branch: master
Commit: ce9911264fd40d055fe2e371a52a7b36ac0877c4
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ce9911264fd40d…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Sep 2 16:42:17 2016 +0200
Fixed exception in alert handler config when trying to create rule without having handlers
---
web/htdocs/valuespec.py | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/web/htdocs/valuespec.py b/web/htdocs/valuespec.py
index e595093..f6acd80 100644
--- a/web/htdocs/valuespec.py
+++ b/web/htdocs/valuespec.py
@@ -1613,6 +1613,13 @@ class CascadingDropdown(ValueSpec):
def from_html_vars(self, varprefix):
choices = self.choices()
+
+ # No choices and "no elements text" is shown: The html var is
+ # not present and no choice can be made. So fallback to default
+ # value and let the validation methods lead to an error message.
+ if not choices:
+ return self.default_value()
+
try:
sel = int(html.var(varprefix + "_sel"))
except: