Module: check_mk
Branch: master
Commit: c7c88afcccc4313a51dff1a8389555b4bb2c4ef2
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c7c88afcccc431…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 15:25:42 2013 +0100
FIX Fixed exception in event simulator when one match group did not match
---
.werks/359 | 8 ++++++++
ChangeLog | 1 +
mkeventd/web/plugins/wato/mkeventd.py | 2 +-
3 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/.werks/359 b/.werks/359
new file mode 100644
index 0000000..75f0eca
--- /dev/null
+++ b/.werks/359
@@ -0,0 +1,8 @@
+Title: Fixed exception in event simulator when one match group did not match
+Level: 1
+Component: ec
+Version: 1.2.5i1
+Date: 1387203915
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index a9d1b67..8bd12a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@
* 0303 FIX: Old log entries were shown in event history first...
* 0304 FIX: Escaping several unwanted chars from incoming log messages...
* 0089 FIX: CSV export of event console was broken...
+ * 0359 FIX: Fixed exception in event simulator when one match group did not match
Livestatus:
* 0337 New header for limiting the execution time of a query...
diff --git a/mkeventd/web/plugins/wato/mkeventd.py b/mkeventd/web/plugins/wato/mkeventd.py
index 655d23d..62dd9e5 100644
--- a/mkeventd/web/plugins/wato/mkeventd.py
+++ b/mkeventd/web/plugins/wato/mkeventd.py
@@ -923,7 +923,7 @@ def mode_mkeventd_rules(phase):
icon = "rulematch"
have_match = True
if groups:
- msg += _(" Match groups: %s") % ",".join(groups)
+ msg += _(" Match groups: %s") % ",".join([ g or _('<None>') for g in groups ])
html.icon(msg, icon)
table.cell(_("ID"), '<a href="%s">%s</a>' % (edit_url, rule["id"]))
Module: check_mk
Branch: master
Commit: 1e8ccc59b80780361176050d1febafff9706b55d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1e8ccc59b80780…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 15:23:50 2013 +0100
Updated bug entries #2092
---
.bugs/2092 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/2092 b/.bugs/2092
index 298da6b..64d9690 100644
--- a/.bugs/2092
+++ b/.bugs/2092
@@ -1,10 +1,13 @@
Title: Impossible to change availability time range when too long to process the page
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2013-11-28 11:58:45
Targetversion: 1.2.3i6
-Class: bug
It is impossible to fix time ranges set by the user in the GUI, when the currently choosen
range results in a never loading availability page, since the settings can only be changed
that page that never loads.
+
+2013-12-16 15:23:48: changed state open -> done
+By imposing a time limit on the query.
Module: check_mk
Branch: master
Commit: d015fdd672532e4dd7cedcad1c6b1852caa93262
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d015fdd672532e…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 15:20:50 2013 +0100
FIX Introduce time limit on availability queries
The availability view now imposes an upper limit on the execution of the
underlying livestatus query. The default is 30 seconds. This can be configured
in the reporting options. This limit keeps the system usable in situations
where a query over a long time range would need a very long time to execute.
---
.werks/338 | 13 +++++++++++++
ChangeLog | 1 +
web/plugins/views/availability.py | 13 +++++++++++++
3 files changed, 27 insertions(+)
diff --git a/.werks/338 b/.werks/338
new file mode 100644
index 0000000..ac3f467
--- /dev/null
+++ b/.werks/338
@@ -0,0 +1,13 @@
+Title: Introduce time limit on availability queries
+Level: 2
+Component: reporting
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387203559
+Targetversion: future
+
+The availability view now imposes an upper limit on the execution of the
+underlying livestatus query. The default is 30 seconds. This can be configured
+in the reporting options. This limit keeps the system usable in situations
+where a query over a long time range would need a very long time to execute.
diff --git a/ChangeLog b/ChangeLog
index 80ddcf8..12dff53 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -58,6 +58,7 @@
Reporting & Availability:
* 0018 New option for displaying a legend for the colors used in the timeline...
+ * 0338 FIX: Introduce time limit on availability queries...
Event Console:
* 0301 Handling messages of special syslog format correctly...
diff --git a/web/plugins/views/availability.py b/web/plugins/views/availability.py
index ba300b7..8db618f 100644
--- a/web/plugins/views/availability.py
+++ b/web/plugins/views/availability.py
@@ -391,6 +391,17 @@ avoption_entries = [
label = _("Show timeline of each object directly in table")),
),
+ # Timelimit
+ ( "timelimit",
+ "single",
+ Age(
+ title = _("Query Time Limit"),
+ default_value = 30,
+ unit = _("sec"),
+ help = _("Limit the execution time of the query, in order to "
+ "avoid a hanging system."),
+ ),
+ )
]
@@ -431,6 +442,7 @@ def render_availability_options():
"av_levels" : None,
"av_mode" : False,
"grouping" : None,
+ "timelimit" : 30,
}
# Users of older versions might not have all keys set. The following
@@ -573,6 +585,7 @@ def get_availability_data(datasource, filterheaders, range, only_sites, limit, s
av_filter += "Filter: service_description =\n"
query = "GET statehist\n" + av_filter
+ query += "Timelimit: %d\n" % avoptions["timelimit"]
# Add Columns needed for object identification
columns = [ "host_name", "service_description" ]
Module: check_mk
Branch: master
Commit: dfa4ee396bea7023eac8a2c811f2ae7bcdd2dc48
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dfa4ee396bea70…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 13:57:53 2013 +0100
FIX megaraid_bbu: Fixed expected state checking
The check was unable to check the hard coded expected states. This
made the check never raise expected alerts.
---
.werks/357 | 11 +++++++++++
ChangeLog | 1 +
checks/megaraid_bbu | 16 ++++++++--------
3 files changed, 20 insertions(+), 8 deletions(-)
diff --git a/.werks/357 b/.werks/357
new file mode 100644
index 0000000..f13596b
--- /dev/null
+++ b/.werks/357
@@ -0,0 +1,11 @@
+Title: megaraid_bbu: Fixed expected state checking
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387198439
+Targetversion: future
+
+The check was unable to check the hard coded expected states. This
+made the check never raise expected alerts.
diff --git a/ChangeLog b/ChangeLog
index e37fa14..09ec106 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
* 0059 FIX: agent_vpshere: new option for supporting ESX 4.1...
* 0334 FIX: cisco_fantray: Fixed error on Cisco devices which do not support this check...
* 0355 FIX: heartbeat_crm: Now handling "Failed actions:" output in agent...
+ * 0357 FIX: megaraid_bbu: Fixed expected state checking...
Multisite:
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
diff --git a/checks/megaraid_bbu b/checks/megaraid_bbu
index 54cf2cf..b7e097e 100644
--- a/checks/megaraid_bbu
+++ b/checks/megaraid_bbu
@@ -90,10 +90,15 @@ def check_megaraid_bbu(item, _no_params, info):
# if your bbu chipset fails and you still get a partial response this will lead
# to a false result. but people asked for it :>
try:
- if controller[varname] != refvalue:
- broken.append("%s is %s, but should be %s(%s)" % (varname, value, refvalue, "!" * refstate))
+ value = controller[varname]
+ if value != refvalue:
+ text = '%s is %s' % (varname, value)
+ if refstate:
+ text += ' (%s)' % ("!" * refstate)
+ text += ' (Expected: %s)' % refvalue
+ broken.append(text)
state = max(state, refstate)
- except:
+ except KeyError:
pass
if controller.get("Learn Cycle Active") == "Yes":
@@ -104,11 +109,6 @@ def check_megaraid_bbu(item, _no_params, info):
else:
return (0, "all states as expected" + charge)
- return (3, "Check not implemented")
-
-
-
-
check_info["megaraid_bbu"] = {
'check_function': check_megaraid_bbu,
'inventory_function': inventory_megaraid_bbu,
Module: check_mk
Branch: master
Commit: d01f66d6a75f2f5479ba0dcafbb8df97a4497f63
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d01f66d6a75f2f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 14:20:01 2013 +0100
New header for limiting the execution time of a query
The new Livestatus header Timelimit: sets an upper limit
for the execution time of a query. Specify the timeout as
a number of seconds. The following query will stop after
5000 lines of output. If that takes longer than 30 seconds,
then the query <b>fails with no output</b>:
F+:query.lql
GET log
Columns: message
Timelimit: 30
Limit: 5000
F-:
Please note, that <tt>Limit:</tt> and <tt>Timelimit:</tt> have
a different behaviour when the limit is reached:
<li class=list><tt>Limit:</tt> end the query, output all rows that
have been found so far.</li>
<li class=list><tt>Timelimit:</tt> abort the query with an error,
do not output any lines.</li>
---
.werks/337 | 29 +++++++++++++++++++++++++++++
ChangeLog | 1 +
livestatus/src/OutputBuffer.h | 1 +
livestatus/src/Query.cc | 33 +++++++++++++++++++++++++++++++++
livestatus/src/Query.h | 3 +++
5 files changed, 67 insertions(+)
diff --git a/.werks/337 b/.werks/337
new file mode 100644
index 0000000..90fe85e
--- /dev/null
+++ b/.werks/337
@@ -0,0 +1,29 @@
+Title: New header for limiting the execution time of a query
+Level: 1
+Component: livestatus
+Class: feature
+State: unknown
+Version: 1.2.5i1
+Date: 1387199727
+Targetversion: future
+
+The new Livestatus header Timelimit: sets an upper limit
+for the execution time of a query. Specify the timeout as
+a number of seconds. The following query will stop after
+5000 lines of output. If that takes longer than 30 seconds,
+then the query <b>fails with no output</b>:
+
+F+:query.lql
+GET log
+Columns: message
+Timelimit: 30
+Limit: 5000
+F-:
+
+Please note, that <tt>Limit:</tt> and <tt>Timelimit:</tt> have
+a different behaviour when the limit is reached:
+
+<li class=list><tt>Limit:</tt> end the query, output all rows that
+have been found so far.</li>
+<li class=list><tt>Timelimit:</tt> abort the query with an error,
+do not output any lines.</li>
diff --git a/ChangeLog b/ChangeLog
index 089e3cc..4d20cfe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -65,6 +65,7 @@
* 0089 FIX: CSV export of event console was broken...
Livestatus:
+ * 0337 New header for limiting the execution time of a query...
* 0335 FIX: Parse state of downtime notification log entries correctly...
* 0336 FIX: Limit the number of lines read from a single logfile...
diff --git a/livestatus/src/OutputBuffer.h b/livestatus/src/OutputBuffer.h
index b86a583..433435a 100644
--- a/livestatus/src/OutputBuffer.h
+++ b/livestatus/src/OutputBuffer.h
@@ -36,6 +36,7 @@ using namespace std;
#define RESPONSE_CODE_INVALID_HEADER 400
#define RESPONSE_CODE_UNAUTHORIZED 403
#define RESPONSE_CODE_NOT_FOUND 404
+#define RESPONSE_CODE_LIMIT_EXCEEDED 413
#define RESPONSE_CODE_INCOMPLETE_REQUEST 451
#define RESPONSE_CODE_INVALID_REQUEST 452
#define RESPONSE_CODE_UNKNOWN_COLUMN 450
diff --git a/livestatus/src/Query.cc b/livestatus/src/Query.cc
index 138ce94..2da047b 100644
--- a/livestatus/src/Query.cc
+++ b/livestatus/src/Query.cc
@@ -65,6 +65,8 @@ Query::Query(InputBuffer *input, OutputBuffer *output, Table *table) :
_need_ds_separator(false),
_output_format(OUTPUT_FORMAT_CSV),
_limit(-1),
+ _time_limit(-1),
+ _time_limit_timeout(0),
_current_line(0),
_timezone_offset(0)
{
@@ -111,6 +113,9 @@ Query::Query(InputBuffer *input, OutputBuffer *output, Table *table) :
else if (!strncmp(buffer, "Limit:", 6))
parseLimitLine(lstrip(buffer + 6));
+ else if (!strncmp(buffer, "Timelimit:", 10))
+ parseTimelimitLine(lstrip(buffer + 10));
+
else if (!strncmp(buffer, "AuthUser:", 9))
parseAuthUserHeader(lstrip(buffer + 9));
@@ -617,6 +622,26 @@ void Query::parseLimitLine(char *line)
}
}
+
+void Query::parseTimelimitLine(char *line)
+{
+ char *value = next_field(&line);
+ if (!value) {
+ _output->setError(RESPONSE_CODE_INVALID_HEADER, "Header Timelimit: missing value");
+ }
+ else {
+ int timelimit = atoi(value);
+ if (!isdigit(value[0]) || timelimit < 0)
+ _output->setError(RESPONSE_CODE_INVALID_HEADER,
+ "Invalid value for Timelimit: must be non-negative integer (seconds)");
+ else {
+ _time_limit = timelimit;
+ _time_limit_timeout = time(0) + _time_limit;
+ }
+ }
+}
+
+
void Query::parseWaitTimeoutLine(char *line)
{
char *value = next_field(&line);
@@ -782,6 +807,14 @@ bool Query::processDataset(void *data)
if (_limit >= 0 && (int)_current_line > _limit)
return false;
+ // When we reach the time limit we let the query fail. Otherwise the user will
+ // not know that the answer is incomplete.
+ if (_time_limit >= 0 && time(0) >= _time_limit_timeout) {
+ logger(LG_INFO, "Maximum query time of %d seconds exceeded!", _time_limit);
+ _output->setError(RESPONSE_CODE_LIMIT_EXCEEDED, "Maximum query time of %d seconds exceeded!", _time_limit);
+ return false;
+ }
+
if (doStats())
{
Aggregator **aggr;
diff --git a/livestatus/src/Query.h b/livestatus/src/Query.h
index 82b864a..ed40902 100644
--- a/livestatus/src/Query.h
+++ b/livestatus/src/Query.h
@@ -74,6 +74,8 @@ class Query
bool _need_ds_separator;
int _output_format;
int _limit;
+ int _time_limit;
+ time_t _time_limit_timeout;
unsigned _current_line;
int _timezone_offset;
@@ -148,6 +150,7 @@ private:
void parseColumnsLine(char *line);
void parseColumnHeadersLine(char *line);
void parseLimitLine(char *line);
+ void parseTimelimitLine(char *line);
void parseSeparatorsLine(char *line);
void parseOutputFormatLine(char *line);
void parseKeepAliveLine(char *line);
Module: check_mk
Branch: master
Commit: 90debecc84089c079bb6aefe25d5f49ac2f3d3fc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=90debecc84089c…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 13:51:50 2013 +0100
Fixed typo in werk 336
---
.werks/336 | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.werks/336 b/.werks/336
index ecb178a..68c452f 100644
--- a/.werks/336
+++ b/.werks/336
@@ -14,7 +14,7 @@ system or even a crash.
In order to avoid such situations the number of lines that are read from each
individual file are now limited. The default limit is one million lines. You
-can change this default by defining the variable <tt>max_lines_per_logfile/tt>
+can change this default by defining the variable <tt>max_lines_per_logfile</tt>
in your <tt>nagios.cfg</tt>. The following example sets the maximum number
to 20 million lines:
Module: check_mk
Branch: master
Commit: 5e9c5cc361536f6a5ece27a7150dcbe04141a2c6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5e9c5cc361536f…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Dec 16 13:48:56 2013 +0100
FIX Limit the number of lines read from a single logfile
If for some reason you have very large history logfiles with millions of
entries then Livestatus would consume large amounts of memory while parsing
these when you access the <tt>log</tt> table. This could lead to a hanging
system or even a crash.
In order to avoid such situations the number of lines that are read from each
individual file are now limited. The default limit is one million lines. You
can change this default by defining the variable <tt>max_lines_per_logfile/tt>
in your <tt>nagios.cfg</tt>. The following example sets the maximum number
to 20 million lines:
F+:
broker_module=/some/path/livestatus.o max_lines_per_logfile=20000000 ...
F-:
When using the Check_MK Micro Core the configuration can be done
via WATO global setting <i>Maximum number of parsed lines per log file</i>.
---
.bugs/959 | 7 +++++--
.werks/336 | 26 ++++++++++++++++++++++++++
ChangeLog | 1 +
livestatus/src/Logfile.cc | 7 ++++++-
livestatus/src/module.c | 5 +++++
5 files changed, 43 insertions(+), 3 deletions(-)
diff --git a/.bugs/959 b/.bugs/959
index d131cb7..ab501ec 100644
--- a/.bugs/959
+++ b/.bugs/959
@@ -1,9 +1,9 @@
Title: Livestatus/Nagios Core crashes, if nagios.log is too large
Component: livestatus
-State: open
+Class: bug
+State: done
Date: 2013-08-08 11:30:12
Targetversion: 1.2.3i5
-Class: bug
In Benutzung war: Nagios 3.3, Check_MK check_mk-1.2.2p2 sowie
mk-livestatus-1.2.2p2 auf einem Centos 5.5.
@@ -28,3 +28,6 @@ vorhandenen Caching-Optionen.
Wichtig hierbei ist, dem Nutzer den Fehler darzustellen und eventuell
auch einen Eintrag im Logfile zu erzeugen. Der Nutzer sollte dann darauf
hingewiesen werden seine Logging-/Rotations-Einstellungen zu aendern.
+
+2013-12-16 13:43:27: changed state open -> done
+Max Zeilen konfigurierbar, default ist 1000000.
diff --git a/.werks/336 b/.werks/336
new file mode 100644
index 0000000..ecb178a
--- /dev/null
+++ b/.werks/336
@@ -0,0 +1,26 @@
+Title: Limit the number of lines read from a single logfile
+Level: 2
+Component: livestatus
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387197814
+Targetversion: future
+
+If for some reason you have very large history logfiles with millions of
+entries then Livestatus would consume large amounts of memory while parsing
+these when you access the <tt>log</tt> table. This could lead to a hanging
+system or even a crash.
+
+In order to avoid such situations the number of lines that are read from each
+individual file are now limited. The default limit is one million lines. You
+can change this default by defining the variable <tt>max_lines_per_logfile/tt>
+in your <tt>nagios.cfg</tt>. The following example sets the maximum number
+to 20 million lines:
+
+F+:
+broker_module=/some/path/livestatus.o max_lines_per_logfile=20000000 ...
+F-:
+
+When using the Check_MK Micro Core the configuration can be done
+via WATO global setting <i>Maximum number of parsed lines per log file</i>.
diff --git a/ChangeLog b/ChangeLog
index 01bca7c..ea881da 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -61,6 +61,7 @@
Livestatus:
* 0335 FIX: Parse state of downtime notification log entries correctly...
+ * 0336 FIX: Limit the number of lines read from a single logfile...
1.2.3i7:
diff --git a/livestatus/src/Logfile.cc b/livestatus/src/Logfile.cc
index b0f84c9..3324554 100644
--- a/livestatus/src/Logfile.cc
+++ b/livestatus/src/Logfile.cc
@@ -38,6 +38,8 @@
extern Core *g_core;
#endif
+extern unsigned long g_max_lines_per_logfile;
+
Logfile::Logfile(const char *path, bool watch)
: _path(strdup(path))
@@ -145,9 +147,12 @@ void Logfile::load(LogCache *logcache, time_t since, time_t until, unsigned logc
void Logfile::loadRange(FILE *file, unsigned missing_types,
LogCache *logcache, time_t since, time_t until, unsigned logclasses)
{
- //logger(LOG_NOTICE, "Read logfile: %s", this->_path);
while (fgets(_linebuffer, MAX_LOGLINE, file))
{
+ if (_lineno >= g_max_lines_per_logfile) {
+ logger(LG_ERR, "More than %u lines in %s. Ignoring the rest!", g_max_lines_per_logfile, this->_path);
+ return;
+ }
_lineno++;
if (processLogLine(_lineno, missing_types)) {
logcache->handleNewMessage(this, since, until, logclasses); // memory management
diff --git a/livestatus/src/module.c b/livestatus/src/module.c
index d1835a7..7d3404d 100644
--- a/livestatus/src/module.c
+++ b/livestatus/src/module.c
@@ -100,6 +100,7 @@ int g_should_terminate = false;
pthread_t g_mainthread_id;
pthread_t *g_clientthread_id;
unsigned long g_max_cached_messages = 500000;
+unsigned long g_max_lines_per_logfile = 1000000; // do never read more than that number of lines from a logfile
unsigned long g_max_response_size = 100 * 1024 * 1024; // limit answer to 10 MB
int g_thread_running = 0;
int g_thread_pid = 0;
@@ -661,6 +662,10 @@ void livestatus_parse_arguments(const char *args_orig)
g_max_cached_messages = strtoul(right, 0, 10);
logger(LG_INFO, "Setting max number of cached log messages to %lu", g_max_cached_messages);
}
+ else if (!strcmp(left, "max_lines_per_logfile")) {
+ g_max_lines_per_logfile = strtoul(right, 0, 10);
+ logger(LG_INFO, "Setting max number lines per logfile to %lu", g_max_lines_per_logfile);
+ }
else if (!strcmp(left, "thread_stack_size")) {
g_thread_stack_size = strtoul(right, 0, 10);
logger(LG_INFO, "Setting size of thread stacks to %lu", g_thread_stack_size);
Module: check_mk
Branch: master
Commit: 326b39e8eaf2be292b799969b90baf4030d46cac
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=326b39e8eaf2be…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 13:36:40 2013 +0100
FIX heartbeat_crm: Now handling "Failed actions:" output in agent
When there is a "Failed actions:" info block provided by the agent,
the inventory code of the check failed with an exception. This has
been fixed now.
---
.werks/355 | 12 ++++++++++++
ChangeLog | 1 +
checks/heartbeat_crm | 4 +++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/355 b/.werks/355
new file mode 100644
index 0000000..878dcd1
--- /dev/null
+++ b/.werks/355
@@ -0,0 +1,12 @@
+Title: heartbeat_crm: Now handling "Failed actions:" output in agent
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387197335
+Targetversion: future
+
+When there is a "Failed actions:" info block provided by the agent,
+the inventory code of the check failed with an exception. This has
+been fixed now.
diff --git a/ChangeLog b/ChangeLog
index 1a990a3..d771a80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -25,6 +25,7 @@
* 0326 FIX: hr_fs printer_supply: Improved translation of wrong encoded chars...
* 0059 FIX: agent_vpshere: new option for supporting ESX 4.1...
* 0334 FIX: cisco_fantray: Fixed error on Cisco devices which do not support this check...
+ * 0355 FIX: heartbeat_crm: Now handling "Failed actions:" output in agent...
Multisite:
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
diff --git a/checks/heartbeat_crm b/checks/heartbeat_crm
index 3b6341c..e5e2611 100644
--- a/checks/heartbeat_crm
+++ b/checks/heartbeat_crm
@@ -138,7 +138,9 @@ def heartbeat_crm_parse_resources(info):
resource = ''
mode = 'single'
for line in info:
- if not blockStart and ' '.join(line) == 'Full list of resources:':
+ if ' '.join(line) == 'Failed actions:':
+ blockStart = False
+ elif not blockStart and ' '.join(line) == 'Full list of resources:':
blockStart = True
elif blockStart:
if ' '.join(line[0:2]) == 'Resource Group:':
Module: check_mk
Branch: master
Commit: 632161b1cc64fa6ecffc4c7318878effda3f3837
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=632161b1cc64fa…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 13:41:55 2013 +0100
FIX Fixed exception caused by utf8 chars in tooltip text
When displaying a view with a column showing utf8 chars in
the tooltip text, this resulted in an exception:
<tt>UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 19: ordinal not in range(128)</tt>
This has been fixed now.
---
.werks/356 | 15 +++++++++++++++
ChangeLog | 1 +
web/htdocs/htmllib.py | 6 ------
web/htdocs/views.py | 2 +-
4 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/.werks/356 b/.werks/356
new file mode 100644
index 0000000..4fcf99c
--- /dev/null
+++ b/.werks/356
@@ -0,0 +1,15 @@
+Title: Fixed exception caused by utf8 chars in tooltip text
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387197640
+Targetversion: future
+
+When displaying a view with a column showing utf8 chars in
+the tooltip text, this resulted in an exception:
+
+<tt>UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 19: ordinal not in range(128)</tt>
+
+This has been fixed now.
diff --git a/ChangeLog b/ChangeLog
index d771a80..e37fa14 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -35,6 +35,7 @@
* 0325 FIX: Removed CSV export icon from availability views...
* 0327 FIX: Most forms did now work with "Profile Requests" enabled...
* 0333 FIX: Fixed too long page title during performing several actions...
+ * 0356 FIX: Fixed exception caused by utf8 chars in tooltip text...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/htdocs/htmllib.py b/web/htdocs/htmllib.py
index a9fb144..c6fff5f 100644
--- a/web/htdocs/htmllib.py
+++ b/web/htdocs/htmllib.py
@@ -1159,12 +1159,6 @@ class html:
else:
return text.encode("utf-8")
- # Old code is soooooooo slow...
- n = ""
- for c in text:
- n += self.u8(c)
- return n
-
# remove all HTML-tags
def strip_tags(self, ht):
if type(ht) not in [str, unicode]:
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 067f0d8..6e5a50c 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -2407,7 +2407,7 @@ def prepare_paint(p, row):
# Tooltip
if content != '' and tooltip:
cla, txt = multisite_painters[tooltip]["paint"](row)
- tooltiptext = html.strip_tags(txt)
+ tooltiptext = html.utf8_to_entities(html.strip_tags(txt))
content = '<span title="%s">%s</span>' % (tooltiptext, content)
return tdclass, content