Module: check_mk
Branch: master
Commit: e087f45a41283faa0f0568e3bfef6c725e93dd44
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e087f45a41283f…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Mar 22 14:36:37 2019 +0100
Event console: Improve help text for host and service contact rulesets
Change-Id: If9fe71e33547f8fc94e3283ee2f126fc1b1806b7
---
cmk/gui/wato/mkeventd.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/cmk/gui/wato/mkeventd.py b/cmk/gui/wato/mkeventd.py
index b977d94..3a93ec0 100644
--- a/cmk/gui/wato/mkeventd.py
+++ b/cmk/gui/wato/mkeventd.py
@@ -3950,9 +3950,10 @@ def _vs_contact(title):
title=title,
help=_("This rule set is useful if you send your monitoring notifications "
"into the Event Console. The contact information that is set by this rule "
- "will be put into the resulting event in the Event Console.") + _(
- " Note: if no contact information is configured for a service "
- "then that of the host will be used instead (if configured)."),
+ "will be put into the resulting event in the Event Console. "
+ "This does not transport contact objects or contact groups, but is a free "
+ "comment field.") + _(" Note: if no contact information is configured for a service "
+ "then that of the host will be used instead (if configured)."),
size=80,
regex=r"^[^;'$|]*$",
regex_error=_("The contact information must not contain one of the characters "
Module: check_mk
Branch: master
Commit: f7b6dcdd5dd3622bae05c7b7698772de5c53e165
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f7b6dcdd5dd362…
Author: Sven Panne <sp(a)mathias-kettner.de>
Date: Fri Mar 22 12:05:21 2019 +0100
6969 FIX Fixed recurring flexible downtimes.
Previously, the combination of "recurring" and "flexible" was broken for
downtimes. The effect was that such downtimes remained hot even outside
their intended time window, so that the next occurring problem just
triggered the start of such a downtime and no problem was notified.
An example for such a scenario: A flexible host downtime was configured to
happen every day between 02:00 and 03:00 for 2 hours. Everything was OK
between 02:00 and 03:00, but at 08:15 the host went DOWN. This started the
downtime, lasting until 10:15, which is of course totally unintended: The
problem did not happen between 02:00-03:00, so the downtime should not start
and normal problem processing should be done, including notifications etc.
This has been fixed, so the recurring flexible downtimes are working as
intended now. If you update your installation, there is nothing more you
have to do, all downtimes automatically work correctly after that. If you
do not want to update yet, you should delete your recurring flexible
downtimes for now and add new recurring fixed downtimes instead as a
workaround until you update.
Change-Id: I16a10a53882d5e9f4fec71ba8af3d5956742c819
---
.werks/6969 | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/.werks/6969 b/.werks/6969
new file mode 100644
index 0000000..c063aac
--- /dev/null
+++ b/.werks/6969
@@ -0,0 +1,27 @@
+Title: Fixed recurring flexible downtimes.
+Level: 2
+Component: cmc
+Compatible: compat
+Edition: cee
+Version: 1.6.0i1
+Date: 1553251801
+Class: fix
+
+Previously, the combination of "recurring" and "flexible" was broken for
+downtimes. The effect was that such downtimes remained hot even outside
+their intended time window, so that the next occurring problem just
+triggered the start of such a downtime and no problem was notified.
+
+An example for such a scenario: A flexible host downtime was configured to
+happen every day between 02:00 and 03:00 for 2 hours. Everything was OK
+between 02:00 and 03:00, but at 08:15 the host went DOWN. This started the
+downtime, lasting until 10:15, which is of course totally unintended: The
+problem did not happen between 02:00-03:00, so the downtime should not start
+and normal problem processing should be done, including notifications etc.
+
+This has been fixed, so the recurring flexible downtimes are working as
+intended now. If you update your installation, there is nothing more you
+have to do, all downtimes automatically work correctly after that. If you
+do not want to update yet, you should delete your recurring flexible
+downtimes for now and add new recurring fixed downtimes instead as a
+workaround until you update.
Module: check_mk
Branch: master
Commit: d587d4b1a837d30a4983ab68dbba4efa41f76a67
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d587d4b1a837d3…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Fri Mar 22 11:20:08 2019 +0100
7069 FIX agent_kubernetes: the kilo suffix for resources may be lowercase
Resolve an issue where parsing of memory failed if the suffix for
memory resources was 'k' instead of 'K'.
Change-Id: Ib63c6472b22c828ecf3888bbbfc6636ebeff13e9
---
.werks/7069 | 12 ++++++++++++
cmk/special_agents/agent_kubernetes.py | 2 +-
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/7069 b/.werks/7069
new file mode 100644
index 0000000..13d7c2a
--- /dev/null
+++ b/.werks/7069
@@ -0,0 +1,12 @@
+Title: agent_kubernetes: the kilo suffix for resources may be lowercase
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.6.0i1
+Date: 1553249538
+
+Resolve an issue where parsing of memory failed if the suffix for
+memory resources was 'k' instead of 'K'.
diff --git a/cmk/special_agents/agent_kubernetes.py b/cmk/special_agents/agent_kubernetes.py
index f5c6293..f6b6bbe 100644
--- a/cmk/special_agents/agent_kubernetes.py
+++ b/cmk/special_agents/agent_kubernetes.py
@@ -131,7 +131,7 @@ def parse_memory(value):
if value.endswith('Ei'):
return 1024**6 * float(value[:-2])
- if value.endswith('K'):
+ if value.endswith('K') or value.endswith('k'):
return 1e3 * float(value[:-1])
if value.endswith('M'):
return 1e6 * float(value[:-1])
Module: check_mk
Branch: master
Commit: 36c1927d2a1e2c8365f9eedae502ea3c0445f15e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=36c1927d2a1e2c…
Author: Tom Baerwinkel <tb(a)mathias-kettner.de>
Date: Thu Mar 21 16:14:09 2019 +0100
7068 FIX Truncate values of the notification context which are too long
If the the value stored in the notification context was larger than
the OS limit MAX_ARG_STRLEN a failed notification was produced and
the error 'OSError: [Errno 7] Argument list too long' appeared in
the notify.log. This was usually the case for very long values in
the long outputs of a service like e.g. fileinfo.groups. Now the
values are truncated and the text 'Attention: Removed remaining
content because it was too long.' is shown at the end.
Change-Id: I726dc536378f54da5dccf624d551b1565ecf0d47
---
.werks/7068 | 16 ++++++++++++++++
cmk_base/notify.py | 35 +++++++++++++++++++++--------------
2 files changed, 37 insertions(+), 14 deletions(-)
diff --git a/.werks/7068 b/.werks/7068
new file mode 100644
index 0000000..3bfc58b
--- /dev/null
+++ b/.werks/7068
@@ -0,0 +1,16 @@
+Title: Truncate values of the notification context which are too long
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1553180240
+Class: fix
+
+If the the value stored in the notification context was larger than
+the OS limit MAX_ARG_STRLEN a failed notification was produced and
+the error 'OSError: [Errno 7] Argument list too long' appeared in
+the notify.log. This was usually the case for very long values in
+the long outputs of a service like e.g. fileinfo.groups. Now the
+values are truncated and the text 'Attention: Removed remaining
+content because it was too long.' is shown at the end.
diff --git a/cmk_base/notify.py b/cmk_base/notify.py
index f669089..94f90ea 100755
--- a/cmk_base/notify.py
+++ b/cmk_base/notify.py
@@ -1310,18 +1310,6 @@ def path_to_notification_script(plugin):
#
# Note: this function is *not* being called for bulk notification.
def call_notification_script(plugin, plugin_context):
- # FIXME: This is a temporary workaround to avoid a possible crash of
- # subprocess.Popen when a crash dump occurs. Since in this case the
- # LONGSERVICEOUTPUT and LONGSERVICEOUTPUT_HTML contain very long base64
- # encoded strings an 'OSError: [Errno 7] Argument list too long' may
- # occur. To avoid this we replace the base64 encoded strings here.
- if plugin_context.get('LONGSERVICEOUTPUT', '').startswith('Crash dump:\\n'):
- plugin_context[
- 'LONGSERVICEOUTPUT'] = u'Check failed:\\nA crash report can be submitted via the user interface.'
- if plugin_context.get('LONGSERVICEOUTPUT_HTML', '').startswith('Crash dump:\\n'):
- plugin_context[
- 'LONGSERVICEOUTPUT_HTML'] = u'Check failed:\\nA crash report can be submitted via the user interface.'
-
core_notification_log(plugin, plugin_context)
def plugin_log(s):
@@ -1374,8 +1362,27 @@ def call_notification_script(plugin, plugin_context):
# Construct the environment for the notification script
def notification_script_env(plugin_context):
- return dict(os.environ.items() +
- [("NOTIFY_" + k, v.encode("utf-8")) for k, v in plugin_context.items()])
+ # Use half of the maximum allowed string length MAX_ARG_STRLEN
+ # which is usually 32 pages on Linux (see "man execve").
+ #
+ # Assumption: We don't have to consider ARG_MAX, i.e. the maximum
+ # size of argv + envp, because it is derived from RLIMIT_STACK
+ # and large enough.
+ try:
+ max_length = 32 * os.sysconf("SC_PAGESIZE") // 2
+ except ValueError:
+ max_length = 32 * 4046 // 2
+
+ def format_(value):
+ if len(value) > max_length:
+ value = value[:max_length] + "...\nAttention: Removed remaining content because it was too long."
+ return value.encode("utf-8")
+
+ notify_env = {
+ "NOTIFY_" + variable: format_(value) for variable, value in plugin_context.iteritems()
+ }
+ notify_env.update(os.environ)
+ return notify_env
class NotificationTimeout(Exception):