Module: check_mk
Branch: master
Commit: b6d6e246e6ce76c14eb37bb244a41adc1fb6a454
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6d6e246e6ce76…
Author: Óscar Nájera <on(a)mathias-kettner.de>
Date: Wed Sep 19 16:02:38 2018 +0200
6640 FIX Fixed context for HOSTURL and SERVICEURL
Links to services and hosts URL missed the site key.
Change-Id: I18dadcc47e07c61a24f4bcf384a9193ebdb7cb3f
---
.werks/6640 | 13 +++++++++++++
cmk_base/events.py | 6 +++---
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/.werks/6640 b/.werks/6640
new file mode 100644
index 0000000..f971f72
--- /dev/null
+++ b/.werks/6640
@@ -0,0 +1,13 @@
+Title: Faster link lookup to Check_MK host or service pages
+Level: 1
+Component: notifications
+Compatible: compat
+Edition: cre
+Version: 1.6.0i1
+Date: 1537365437
+Class: fix
+
+Context variables HOSTURL and SERVICEURL now include the site key, this
+enables a faster lookup and visualization of pages since Check_MK does not
+need to resolve to which site the host belongs. This becomes especialy
+relevant in distributed environments with multiple monitoring sites.
diff --git a/cmk_base/events.py b/cmk_base/events.py
old mode 100644
new mode 100755
index 18bc085..41ac20b
--- a/cmk_base/events.py
+++ b/cmk_base/events.py
@@ -298,11 +298,11 @@ def complete_raw_context(raw_context, with_dump, event_log):
raw_context["MICROTIME"] = "%d" % (time.time()*1000000)
raw_context['HOSTURL'] = '/check_mk/index.py?start_url=%s' % \
-
urllib.quote('view.py?view_name=hoststatus&host=%s' %
raw_context['HOSTNAME'])
+
urllib.quote('view.py?view_name=hoststatus&host=%s&site=%s' %
(raw_context['HOSTNAME'], raw_context['OMD_SITE']))
if raw_context['WHAT'] == 'SERVICE':
raw_context['SERVICEURL'] = '/check_mk/index.py?start_url=%s'
% \
-
urllib.quote('view.py?view_name=service&host=%s&service=%s' %
- (raw_context['HOSTNAME'],
raw_context['SERVICEDESC']))
+
urllib.quote('view.py?view_name=service&host=%s&service=%s&site=%s' %
+ (raw_context['HOSTNAME'],
raw_context['SERVICEDESC'], raw_context['OMD_SITE']))
# Relative Timestamps for several macros
for macro in [ 'LASTHOSTSTATECHANGE', 'LASTSERVICESTATECHANGE',
'LASTHOSTUP', 'LASTSERVICEOK' ]: