Module: check_mk
Branch: master
Commit: 5195ae65da3d67f365443408ff7204a74a22c05f
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5195ae65da3d67…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 27 09:01:36 2017 +0100
4400 FIX Fixed possible random "OSError: [Errno 9] Bad file descriptor" in GUI
During rendering of any page in the GUI this error could occur. Restarting the
apache of the site should fix the issue for some time.
Change-Id: I122a427e6f9ef49d0117b4f98c99ac451a8f2011
---
.werks/4400 | 13 +++++++++++++
lib/store.py | 8 +++++++-
web/htdocs/crash_reporting.py | 1 +
3 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/.werks/4400 b/.werks/4400
new file mode 100644
index 0000000..f29c234
--- /dev/null
+++ b/.werks/4400
@@ -0,0 +1,13 @@
+Title: Fixed possible random "OSError: [Errno 9] Bad file descriptor" in GUI
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1488182205
+
+During rendering of any page in the GUI this error could occur. Restarting the
+apache of the site should be a workaround the issue for some time unitl applying
+the fix shipped with this change.
diff --git a/lib/store.py b/lib/store.py
index 8edf2ce..51f4c69 100644
--- a/lib/store.py
+++ b/lib/store.py
@@ -252,7 +252,13 @@ def release_all_locks():
global g_aquired_locks, g_locked_paths
for _unused_path, fd in g_aquired_locks:
- os.close(fd)
+ try:
+ os.close(fd)
+ except OSError, e:
+ if e.errno == 9: # OSError: [Errno 9] Bad file descriptor
+ pass
+ else:
+ raise
g_aquired_locks = []
g_locked_paths = []
diff --git a/web/htdocs/crash_reporting.py b/web/htdocs/crash_reporting.py
index 6236f47..d88a05f 100644
--- a/web/htdocs/crash_reporting.py
+++ b/web/htdocs/crash_reporting.py
@@ -151,6 +151,7 @@ def get_crash_info(tardata):
def fetch_file_from_tar(tardata, filename):
p = subprocess.Popen(['tar', 'xzf', '-', '--to-stdout', filename],
stdin=subprocess.PIPE, stdout=subprocess.PIPE,
+ stderr=open(os.devnull, "w"),
close_fds=True)
result = p.communicate(tardata)
return result[0]
Module: check_mk
Branch: master
Commit: 049b0f30afb28f3afed4f236ef2ee7ebe4d193e7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=049b0f30afb28f…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Feb 27 08:33:45 2017 +0100
Updated bug entries #2805
Change-Id: Ic83806342382eec102d04287b892c10dd260b959
---
.bugs/2805 | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/2805 b/.bugs/2805
index 1f2040e..4bb1dd3 100644
--- a/.bugs/2805
+++ b/.bugs/2805
@@ -1,9 +1,9 @@
Title: Adding a view to a report ships unneccessary filters
Component: reporting
-State: open
+Class: bug
+State: done
Date: 2015-09-16 12:05:09
Targetversion: future
-Class: bug
Try this: go to the view "host" of some host. Add this to a report using
the small button at the bottom of the page.
@@ -11,3 +11,6 @@ the small button at the bottom of the page.
This view will now be added including the two context filters "Service"
and "Service State". Both are inactive and unncessary, however. Only
active filters should be added.
+
+2017-02-27 08:33:11: changed state open -> done
+This has already been fixed.
Module: check_mk
Branch: master
Commit: dfe426184df96bdfcaab16f3f49c6731dc872521
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dfe426184df96b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 24 10:22:36 2017 +0100
4397 FIX Views: Fixed datasource KeyError exception
When e.g. a Event Console related view was added to a dashboard and
then the Event Console was disabled or that site, this could lead
into a KeyError exception when rendering the dashboard, because the
datasource was not existant anymore.
Change-Id: Ie0f9fd35300e6ff5ebe594e013c6d0eb6d8b1b1a
---
.werks/4397 | 14 ++++++++++++++
web/htdocs/views.py | 13 ++++++++++++-
2 files changed, 26 insertions(+), 1 deletion(-)
diff --git a/.werks/4397 b/.werks/4397
new file mode 100644
index 0000000..8e17c5c
--- /dev/null
+++ b/.werks/4397
@@ -0,0 +1,14 @@
+Title: Views: Fixed datasource KeyError exception
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1487928038
+
+When e.g. a Event Console related view was added to a dashboard and
+then the Event Console was disabled or that site, this could lead
+into a KeyError exception when rendering the dashboard, because the
+datasource was not existant anymore.
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 99b2686..2be24b2 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -1466,7 +1466,18 @@ def show_view(view, show_heading = False, show_buttons = True,
show_checkboxes = force_checkboxes or html.var('show_checkboxes', '0') == '1'
# Get the datasource (i.e. the logical table)
- datasource = multisite_datasources[view["datasource"]]
+ try:
+ datasource = multisite_datasources[view["datasource"]]
+ except KeyError:
+ if view["datasource"].startswith("mkeventd_"):
+ raise MKUserError(None,
+ _("The Event Console view '%s' can not be rendered. The Event Console is possibly "
+ "disabled.") % view["name"])
+ else:
+ raise MKUserError(None,
+ _("The view '%s' using the datasource '%s' can not be rendered "
+ "because the datasource does not exist.") % (view["name"], view["datasource"]))
+
tablename = datasource["table"]
# Filters to use in the view
Module: check_mk
Branch: master
Commit: 51b987cd0697445a7e77fb245a337f6d38d0a9dc
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=51b987cd069744…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Feb 24 10:59:48 2017 +0100
4399 FIX Views: Fixed graph showing views of services with invalid perfdata
Some checks that produced invalid perfdata like 'key=" "' were causing the
metric parsing to crash with a "IndexError (list index out of range)" error.
The metric parsing is now skipping those invalid values.
Change-Id: I5b0ab12e2a0d32546823c8a588fdadd6c9453d0b
---
.werks/4399 | 14 ++++++++++++++
web/htdocs/metrics.py | 4 +++-
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/.werks/4399 b/.werks/4399
new file mode 100644
index 0000000..d0be212
--- /dev/null
+++ b/.werks/4399
@@ -0,0 +1,14 @@
+Title: Views: Fixed graph showing views of services with invalid perfdata
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1487930278
+
+Some checks that produced invalid perfdata like 'key=" "' were causing the
+metric parsing to crash with a "IndexError (list index out of range)" error.
+
+The metric parsing is now skipping those invalid values.
diff --git a/web/htdocs/metrics.py b/web/htdocs/metrics.py
index 7240e48..be5bc61 100644
--- a/web/htdocs/metrics.py
+++ b/web/htdocs/metrics.py
@@ -351,7 +351,7 @@ def parse_perf_data(perf_data_string, check_command=None):
while len(value_parts) < 5:
value_parts.append(None)
value_text, warn, crit, min, max = value_parts[0:5]
- if value_text == "":
+ if value_text.strip() == "":
continue # ignore useless empty variable
# separate value from unit
@@ -361,6 +361,8 @@ def parse_perf_data(perf_data_string, check_command=None):
i += 1
unit_name = value_text[i:]
+ if value_text[:i] == "":
+ continue
value = float_or_int(value_text[:i])
perf_data_tuple = (varname, value, unit_name)