Module: check_mk
Branch: master
Commit: a01205c72d38baac68f4aa03669e93fc025e4d61
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a01205c72d38ba…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Sep 30 16:30:46 2015 +0200
#2645 FIX Fix garbled notification context when \n appears in service description
When your service has the name <tt>C:\tmp\network.log</tt>, then the <tt>\n</tt> would
be interpreted as newline and everything after the \ was lost. This has been fixed.
---
.werks/2645 | 10 ++++++++++
ChangeLog | 1 +
modules/events.py | 13 ++++++++++---
modules/notify.py | 4 ++--
4 files changed, 23 insertions(+), 5 deletions(-)
diff --git a/.werks/2645 b/.werks/2645
new file mode 100644
index 0000000..143839b
--- /dev/null
+++ b/.werks/2645
@@ -0,0 +1,10 @@
+Title: Fix garbled notification context when \n appears in service description
+Level: 2
+Component: notifications
+Compatible: compat
+Version: 1.2.7i3
+Date: 1443623319
+Class: fix
+
+When your service has the name <tt>C:\tmp\network.log</tt>, then the <tt>\n</tt> would
+be interpreted as newline and everything after the \ was lost. This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 85d86de..f8c2f56 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -301,6 +301,7 @@
* 2347 FIX: Improved error message in notify.log when sendmail is missing
* 2348 FIX: HTML-Mails: Added missing link to service descriptions
* 2349 FIX: HTML-Mails: Fixed state colors in Outlook
+ * 2645 FIX: Fix garbled notification context when \n appears in service description...
BI:
* 2537 BI Editor: restructured, now show tree structure of aggregations, show unused rules...
diff --git a/modules/events.py b/modules/events.py
index fe2dff7..60b198c 100644
--- a/modules/events.py
+++ b/modules/events.py
@@ -123,21 +123,28 @@ def raw_context_from_string(data):
try:
for line in data.split('\n'):
varname, value = line.strip().split("=", 1)
- context[varname] = value.replace(r"\n", "\n").replace("\\\\", "\\")
+ context[varname] = expand_backslashes(value)
except Exception, e: # line without '=' ignored or alerted
if opt_debug:
raise
return context
-
def raw_context_from_stdin():
context = {}
for line in sys.stdin:
varname, value = line.strip().split("=", 1)
- context[varname] = value.replace(r"\n", "\n").replace("\\\\", "\\")
+ context[varname] = expand_backslashes(value)
return context
+def expand_backslashes(value):
+ # We cannot do the following:
+ # value.replace(r"\n", "\n").replace("\\\\", "\\")
+ # \\n would be exapnded to \<LF> instead of \n. This was a bug
+ # in previous versions.
+ return value.replace("\\\\", "\0").replace("\\n", "\n").replace("\0", "\\")
+
+
def convert_context_to_unicode(context):
# Convert all values to unicode
for key, value in context.iteritems():
diff --git a/modules/notify.py b/modules/notify.py
index 5be18a5..b5c6a86 100644
--- a/modules/notify.py
+++ b/modules/notify.py
@@ -236,8 +236,8 @@ def notify_notify(raw_context, analyse=False):
notify_log("Analysing notification (%s) context with %s variables" % (
find_host_service_in_context(raw_context), len(raw_context)))
else:
- notify_log("Got raw notification (%s) context with %s variables" % (
- find_host_service_in_context(raw_context), len(raw_context)))
+ notify_log("Got raw notification (%s) context with %s variables (%r)" % (
+ find_host_service_in_context(raw_context), len(raw_context), raw_context))
# Add some further variable for the conveniance of the plugins
Module: check_mk
Branch: master
Commit: 36f25626f032ceca65b8dd59f96dae9d7d556873
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=36f25626f032ce…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 30 14:21:22 2015 +0200
#2617 FIX Improved error handling in case of agent error but piggyback data available
---
.werks/2617 | 9 +++++++++
ChangeLog | 1 +
modules/check_mk_base.py | 10 ++++++----
3 files changed, 16 insertions(+), 4 deletions(-)
diff --git a/.werks/2617 b/.werks/2617
new file mode 100644
index 0000000..ea3c4e4
--- /dev/null
+++ b/.werks/2617
@@ -0,0 +1,9 @@
+Title: Improved error handling in case of agent error but piggyback data available
+Level: 1
+Component: core
+Compatible: compat
+Version: 1.2.7i3
+Date: 1443615665
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 239b5e1..ee78898 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* 2630 FIX: fixed incorrect check interval of Check_MK Discovery...
* 2430 FIX: Fixed crash with availability queries when using nagios as core...
* 2643 FIX: Fix spurious CRIT status on check on mknotifyd...
+ * 2617 FIX: Improved error handling in case of agent error but piggyback data available
Checks & Agents:
* 2312 New checks for EMC VPLEX: emc_vplex_cpu, emc_vplex_director_stats, emc_vplex_if, emc_vplex_volumes...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 7d8a32a..6e9a9cb 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -482,7 +482,7 @@ def get_realhost_info(hostname, ipaddress, check_type, max_cache_age, ignore_che
piggy_output = get_piggyback_info(hostname) + get_piggyback_info(ipaddress)
output = ""
- agent_failed = False
+ agent_failed_exc = None
if is_tcp_host(hostname):
try:
output = get_agent_info(hostname, ipaddress, max_cache_age)
@@ -490,7 +490,7 @@ def get_realhost_info(hostname, ipaddress, check_type, max_cache_age, ignore_che
raise
except Exception, e:
- agent_failed = True
+ agent_failed_exc = e
# Remove piggybacked information from the host (in the
# role of the pig here). Why? We definitely haven't
# reached that host so its data from the last time is
@@ -499,6 +499,8 @@ def get_realhost_info(hostname, ipaddress, check_type, max_cache_age, ignore_che
if not piggy_output:
raise
+ elif opt_debug:
+ raise
output += piggy_output
@@ -523,8 +525,8 @@ def get_realhost_info(hostname, ipaddress, check_type, max_cache_age, ignore_che
# If the agent has failed and the information we seek is
# not contained in the piggy data, raise an exception
if check_type not in info:
- if agent_failed:
- raise MKAgentError("Cannot get information from agent, processing only piggyback data.")
+ if agent_failed_exc:
+ raise MKAgentError("Cannot get information from agent (%s), processing only piggyback data." % agent_failed_exc)
else:
return []
Module: check_mk
Branch: master
Commit: 122dc535ad358404d018c9d0f2167bbfc5dc7645
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=122dc535ad3584…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Sep 29 16:37:43 2015 +0200
fixed typo
---
agents/check_mk_agent.linux | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/agents/check_mk_agent.linux b/agents/check_mk_agent.linux
index 346baad..a0f574c 100755
--- a/agents/check_mk_agent.linux
+++ b/agents/check_mk_agent.linux
@@ -313,7 +313,7 @@ then
else
IPMI_FORMAT=""
fi
- # At least with ipmi-sensoirs 0.7.16 this group is Power_Unit instead of "Power Unit"
+ # At least with ipmi-sensors 0.7.16 this group is Power_Unit instead of "Power Unit"
run_cached -s ipmi_sensors 300 "for class in Temperature Power_Unit Fan
do
ipmi-sensors $IPMI_FORMAT --sdr-cache-directory /var/cache -g "$class" | sed -e 's/ /_/g' -e 's/:_\?/ /g' -e 's@ \([^(]*\)_(\([^)]*\))@ \2_\1@'
Module: check_mk
Branch: master
Commit: 08712e29f2e41c3b354f832fd4ade6adf5fcf706
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=08712e29f2e41c…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Sep 29 16:03:45 2015 +0200
#2653 FIX winperf_msx_queues: fixed incorrect cancelation of check claiming no counters were available
In versions 1.2.6p11 and 1.2.6p12 this check would report unknown state with the message "no
counters available, transport service running?" even though there were counters
---
.werks/2653 | 11 +++++++++++
ChangeLog | 1 +
checks/winperf_msx_queues | 2 +-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/2653 b/.werks/2653
new file mode 100644
index 0000000..948face
--- /dev/null
+++ b/.werks/2653
@@ -0,0 +1,11 @@
+Title: winperf_msx_queues: fixed incorrect cancelation of check claiming no counters were available
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1443535176
+
+In versions 1.2.6p11 and 1.2.6p12 this check would report unknown state with the message "no
+counters available, transport service running?" even though there were counters
diff --git a/ChangeLog b/ChangeLog
index 54c4900..239b5e1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -203,6 +203,7 @@
* 2609 FIX: mysql_capacity: Can now handle sizes reported being NULL...
* 2627 FIX: knuerr_sensors: no longer creates a service for unnamed sensor...
* 2631 FIX: janitza_umg_freq: fixed crash when no frequency measurements were reported by the device
+ * 2653 FIX: winperf_msx_queues: fixed incorrect cancelation of check claiming no counters were available...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce unhandled exceptions...
diff --git a/checks/winperf_msx_queues b/checks/winperf_msx_queues
index 3e2ba1c..53c4b1c 100644
--- a/checks/winperf_msx_queues
+++ b/checks/winperf_msx_queues
@@ -91,7 +91,7 @@ def inventory_winperf_msx_queues(info):
def check_winperf_msx_queues(item, params, info):
# current windows agents should not produce winperf sections with no data after the header but
# this ensures compatibility with older agents
- if len(info) < 2 or int(info[1][0]):
+ if len(info) < 2 or int(info[1][0]) < 1:
return 3, "no counters available, transport service running?"
# Old default case: