Module: check_mk
Branch: master
Commit: b19a537f718d1956e1d1273acdf0f67219d43905
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b19a537f718d19…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Jun 20 15:06:54 2017 +0200
4835 windows_updates.vbs: this plugin automatically configured to asynchron execution and 4 hours cached
You can still overwrite these hardcoded values with the WATO rules <i>Set cache age for plugins and local
checks</i> and <i>Set execution mode for plugins and local checks</i>.
Change-Id: I3a3888eb9e59261d28b37ab326964c7f334c9e89
---
.werks/4835 | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/.werks/4835 b/.werks/4835
new file mode 100644
index 0000000..e360cf3
--- /dev/null
+++ b/.werks/4835
@@ -0,0 +1,12 @@
+Title: windows_updates.vbs: this plugin automatically configured to asynchron execution and 4 hours cached
+Level: 1
+Component: wato
+Compatible: compat
+Edition: cre
+Version: 1.5.0i1
+Date: 1497963919
+Class: feature
+
+You can still overwrite these hardcoded values with the WATO rules <i>Set cache age for plugins and local
+checks</i> and <i>Set execution mode for plugins and local checks</i>.
+
Module: check_mk
Branch: master
Commit: 203d93c582d01294a3fa445a7542401f2e095d1a
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=203d93c582d012…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jun 20 14:55:07 2017 +0200
Extension to #4761: Suppress MKLivestatusTableNotFoundError() by default
Change-Id: If3e5ff659e39dd77e08c4794e2640c34c9b08080
---
livestatus/api/python/livestatus.py | 10 ++++++++--
web/plugins/sidebar/shipped.py | 13 +------------
2 files changed, 9 insertions(+), 14 deletions(-)
diff --git a/livestatus/api/python/livestatus.py b/livestatus/api/python/livestatus.py
index 7352ca4..ddb1d09 100644
--- a/livestatus/api/python/livestatus.py
+++ b/livestatus/api/python/livestatus.py
@@ -182,11 +182,17 @@ class Query(object):
query. The object can be used to hand over the handling code some flags, for
example to influence the error handling during query processing."""
+ default_suppressed_exceptions = [MKLivestatusTableNotFoundError]
+
def __init__(self, query, suppress_exceptions=None):
super(Query, self).__init__()
self._query = self._ensure_unicode(query)
- self.suppress_exceptions = suppress_exceptions or []
+
+ if suppress_exceptions == None:
+ self.suppress_exceptions = self.default_suppressed_exceptions
+ else:
+ self.suppress_exceptions = suppress_exceptions
def _ensure_unicode(self, thing):
@@ -743,7 +749,7 @@ class MultiSiteConnection(Helpers):
if isinstance(query, Query):
suppress_exceptions = tuple(query.suppress_exceptions)
else:
- suppress_exceptions = tuple()
+ suppress_exceptions = tuple(Query.default_suppressed_exceptions)
# Then retrieve all answers. We will be as slow as the slowest of all
# connections.
diff --git a/web/plugins/sidebar/shipped.py b/web/plugins/sidebar/shipped.py
index c93ddd2..4bf3e13 100644
--- a/web/plugins/sidebar/shipped.py
+++ b/web/plugins/sidebar/shipped.py
@@ -637,20 +637,9 @@ def get_tactical_overview_data(extra_filter_headers):
stat_only=True,
extra_headers=extra_filter_headers)
- # Livestatus < 1.4.0 does not know this table. The API will raise a
- # MKLivestatusTableNotFoundError exception in this case which will mark
- # the site as dead by default. Adding the exception to the list of
- # suppressed exception makes livestatus silently ignore this kind of
- # error. This makes it possible to make livestatus connections with
- # older Check_MK versions.
- query = livestatus.Query(
- event_query,
- suppress_exceptions=[livestatus.MKLivestatusTableNotFoundError],
- )
-
try:
sites.live().set_auth_domain("ec")
- event_data = sites.live().query_summed_stats(query)
+ event_data = sites.live().query_summed_stats(event_query)
except livestatus.MKLivestatusNotFoundError:
event_data = [0, 0, 0]
finally:
Module: check_mk
Branch: master
Commit: 5c14bd9e3d7def5495d837b5f60d07cd804c50b5
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5c14bd9e3d7def…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jun 20 13:46:09 2017 +0200
4888 FIX Fixed missing link to "events of host" view for hosts the user may see
In the "all events" view, there are links on the host names to a view which
shows all events related to that host. In previous 1.4 versions these links
were broken when the user was not a contact of these hosts but permitted
to see the events of all hosts.
Change-Id: I8ffd3cba68413d87d92c2b62a85cfd0f617ff8a8
---
.werks/4888 | 14 ++++++++++++++
web/plugins/views/mkeventd.py | 4 ++--
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.werks/4888 b/.werks/4888
new file mode 100644
index 0000000..4024d5b
--- /dev/null
+++ b/.werks/4888
@@ -0,0 +1,14 @@
+Title: Fixed missing link to "events of host" view for hosts the user may see
+Level: 1
+Component: ec
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i1
+Date: 1497959040
+
+In the "all events" view, there are links on the host names to a view which
+shows all events related to that host. In previous 1.4 versions these links
+were broken when the user was not a contact of these hosts but permitted
+to see the events of all hosts.
diff --git a/web/plugins/views/mkeventd.py b/web/plugins/views/mkeventd.py
index 0977063..fa769b6 100644
--- a/web/plugins/views/mkeventd.py
+++ b/web/plugins/views/mkeventd.py
@@ -75,8 +75,8 @@ def query_ec_table(datasource, columns, add_columns, query, only_sites, limit, t
# the "mkeventd.seeall" permissions. So it is simply not possible to do this on
# core level at the moment.
def _ec_filter_host_information_of_not_permitted_hosts(rows):
- if not config.user.may("mkeventd.seeall"):
- return
+ if config.user.may("mkeventd.seeall"):
+ return # Don't remove anything. The user may see everything
user_groups = set(config.user.contact_groups())
Module: check_mk
Branch: master
Commit: cd43af2f8a0fcb71dae72eace4ae73dd6f6a01f3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cd43af2f8a0fcb…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Jun 20 14:01:08 2017 +0200
Fix links from EC list views to "EC events of host" for unrelated hosts
Change-Id: Ia230e1917e3068f7a43d684f7eea49c6a5ae63b6
---
web/plugins/views/mkeventd.py | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/web/plugins/views/mkeventd.py b/web/plugins/views/mkeventd.py
index fa769b6..7e598e3 100644
--- a/web/plugins/views/mkeventd.py
+++ b/web/plugins/views/mkeventd.py
@@ -58,10 +58,19 @@ def query_ec_table(datasource, columns, add_columns, query, only_sites, limit, t
_ec_filter_host_information_of_not_permitted_hosts(rows)
- if config.user.may("mkeventd.seeunrelated"):
- return rows # user is allowed to see all events returned by the core
+ if not config.user.may("mkeventd.seeunrelated"):
+ # user is not allowed to see all events returned by the core
+ rows = [ r for r in rows if r["event_contact_groups"] != [] or r["host_name"] != "" ]
+
+ # Now we don't need to distinguish anymore between unrelated and related events. We
+ # need the host_name field for rendering the views. Try our best and use the
+ # event_host value as host_name.
+ for row in rows:
+ if not row.get("host_name"):
+ row["host_name"] = row["event_host"]
+
+ return rows
- return [ r for r in rows if r["event_contact_groups"] != [] or r["host_name"] != "" ]
# Handle the case where a user is allowed to see all events (-> events for hosts he