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
Module: check_mk
Branch: master
Commit: d515d70c1ac3853a159ffff938263c9d686815ec
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d515d70c1ac385…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 13:28:25 2013 +0100
FIX cisco_fantray: Fixed error on Cisco devices which do not support this check
When doing an inventory on cisco devices which did not support this check, the
check created an error message.
---
.werks/334 | 11 +++++++++++
ChangeLog | 1 +
checks/cisco_fantray | 2 +-
3 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/.werks/334 b/.werks/334
new file mode 100644
index 0000000..09bda47
--- /dev/null
+++ b/.werks/334
@@ -0,0 +1,11 @@
+Title: cisco_fantray: Fixed error on Cisco devices which do not support this check
+Level: 1
+Component: checks
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387196790
+Targetversion: future
+
+When doing an inventory on cisco devices which did not support this check, the
+check created an error message.
diff --git a/ChangeLog b/ChangeLog
index 62a1ab9..1a990a3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
* 0243 FIX: cisco_qos: no longer crashes when the qos policy name is not set...
* 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...
Multisite:
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
diff --git a/checks/cisco_fantray b/checks/cisco_fantray
index 3a5f5eb..65a1e36 100644
--- a/checks/cisco_fantray
+++ b/checks/cisco_fantray
@@ -27,7 +27,7 @@
cisco_fan_states = ('', 'unknown', 'up', 'down', 'warning')
def inventory_cisco_fantray(info):
- if info[0]:
+ if info and info[0]:
return [ (line[0], None) for line in info ]
def check_cisco_fantray(item, params, info):
Module: check_mk
Branch: master
Commit: afa0d7c737cc44985458060103649b738b39d46f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=afa0d7c737cc44…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 13:16:13 2013 +0100
FIX Fixed too long page title during performing several actions
The page title reflects the current page. A bug caused this page title
to be appended to the current title instead of being replaced. This resulted
in too long page titles when performing e.g. actions in WATO
---
.werks/333 | 12 ++++++++++++
ChangeLog | 1 +
web/htdocs/js/sidebar.js | 9 ++++-----
3 files changed, 17 insertions(+), 5 deletions(-)
diff --git a/.werks/333 b/.werks/333
new file mode 100644
index 0000000..ac66414
--- /dev/null
+++ b/.werks/333
@@ -0,0 +1,12 @@
+Title: Fixed too long page title during performing several actions
+Level: 1
+Component: multisite
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387196080
+Targetversion: future
+
+The page title reflects the current page. A bug caused this page title
+to be appended to the current title instead of being replaced. This resulted
+in too long page titles when performing e.g. actions in WATO
diff --git a/ChangeLog b/ChangeLog
index 4b837b9..62a1ab9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
* 0312 FIX: Hiding views related to not existing datasources, like the EC now...
* 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...
WATO:
* 0308 Multisite can now set rotation view permissions for NagVis...
diff --git a/web/htdocs/js/sidebar.js b/web/htdocs/js/sidebar.js
index 67940f6..19b8c57 100644
--- a/web/htdocs/js/sidebar.js
+++ b/web/htdocs/js/sidebar.js
@@ -26,7 +26,6 @@ var browser = navigator.userAgent.toLowerCase();
var weAreIEF__k = ((browser.indexOf("msie") != -1) && (browser.indexOf("opera") == -1));
var weAreOpera = browser.indexOf("opera") != -1;
var weAreFirefox = browser.indexOf("firefox") != -1 || browser.indexOf("namoroka") != -1;
-var g_orig_title = null;
var g_content_loc = null;
var sidebar_folded = false;
@@ -363,8 +362,8 @@ function contentFrameAccessible() {
function update_content_location() {
// init the original frameset title
- if (g_orig_title == null) {
- g_orig_title = window.parent.document.title;
+ if (typeof(window.parent.orig_title) == 'undefined') {
+ window.parent.orig_title = window.parent.document.title;
}
var content_frame = window.parent.frames[1];
@@ -372,9 +371,9 @@ function update_content_location() {
// Change the title to add the right frame title to reflect the
// title of the content URL in the framesets title (window title or tab title)
if (content_frame.document.title != '') {
- var page_title = g_orig_title + ' - ' + content_frame.document.title;
+ var page_title = window.parent.orig_title + ' - ' + content_frame.document.title;
} else {
- var page_title = g_orig_title;
+ var page_title = window.parent.orig_title;
}
window.parent.document.title = page_title;
Module: check_mk
Branch: master
Commit: 975679128a452448a3d2bd60c8badfd53b122749
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=975679128a4524…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 16 12:37:37 2013 +0100
FIX Own host tag groups without topics resulted in two groups "Host tags" in the rule editor
Conflicts:
.bugs/1081
---
.bugs/1081 | 13 +++++++++++++
.werks/332 | 9 +++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 4 +++-
4 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/.bugs/1081 b/.bugs/1081
new file mode 100644
index 0000000..f451a2f
--- /dev/null
+++ b/.bugs/1081
@@ -0,0 +1,13 @@
+Title: Own host tag groups without topics are sorted in own group
+Component: wato
+Class: bug
+State: done
+Date: 2013-12-16 11:33:59
+Targetversion: 1.2.4
+
+Create a tag group. Do not set a topic. That tag group will be
+displayed in an own folder with the title "Host Tags". That folder
+is thus duplicate.
+
+2013-12-16 12:36:31: changed state open -> done
+This occured in the rule editor. has been fixed now
diff --git a/.werks/332 b/.werks/332
new file mode 100644
index 0000000..2a6acea
--- /dev/null
+++ b/.werks/332
@@ -0,0 +1,9 @@
+Title: Own host tag groups without topics resulted in two groups "Host tags" in the rule editor
+Level: 1
+Component: wato
+Class: fix
+State: unknown
+Version: 1.2.5i1
+Date: 1387193799
+Targetversion: future
+
diff --git a/ChangeLog b/ChangeLog
index 7a17c48..10bd873 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,6 +45,7 @@
* 0311 FIX: Fixed "Inventory failed" message when trying an inventory on clusters via WATO...
* 0330 FIX: Improved performance of WATO slave push with a large user base...
* 0331 FIX: LDAP diagnostic LOG can now have the $OMD_SITE$ macro configured via WATO...
+ * 0332 FIX: Own host tag groups without topics resulted in two groups "Host tags" in the rule editor
Notifications:
* 0108 FIX: Prevent service notification on host alerts...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 02c2f40..8e2f0be 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -9577,6 +9577,8 @@ def group_hosttags_by_topic(hosttags):
tags = {}
for entry in hosttags:
topic, title = parse_hosttag_title(entry[1])
+ if not topic:
+ topic = _('Host tags')
tags.setdefault(topic, [])
tags[topic].append((entry[0], title) + entry[2:])
return sorted(tags.items(), key = lambda x: x[0])
@@ -11745,7 +11747,7 @@ def render_condition_editor(tag_specs, varprefix=""):
make_foldable = len(hosttags) > 1
for topic, grouped_tags in hosttags:
if make_foldable:
- html.begin_foldable_container("topic", topic, True, "<b>%s</b>" % (topic or _('Host tags')))
+ html.begin_foldable_container("topic", topic, True, "<b>%s</b>" % (topic))
html.write("<table class=\"hosttags\">")
# Show main tags