Module: check_mk
Branch: master
Commit: a0f74fe9c4c647012d4298bb8192330565ab9fcf
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a0f74fe9c4c647…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Sep 18 10:05:46 2013 +0200
OMG! Found a way to make F5 / browser reloads work as expected
This works at least in current firefox, chrome, safari. Cross fingers,
maybe this also works in current IE versions... Have not tested this
yet.
---
ChangeLog | 2 ++
web/htdocs/js/sidebar.js | 43 ++++++++++++++++++++++++++++++++++++++-----
web/htdocs/sidebar.py | 3 ++-
3 files changed, 42 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a2b71c0..895d1c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -108,6 +108,8 @@
* HTML notifications: Added time of state change
Multisite:
+ * Finally good handling of F5 / browser reloads -> no page switching to
+ start page anymore (at least in modern browsers)
* User accounts can now be locked after a specified amount of auth
failures (lock_on_logon_failures can be set to a number of tries)
* Column Perf-O-Meter is now sortable: it sorts after the *first*
diff --git a/web/htdocs/js/sidebar.js b/web/htdocs/js/sidebar.js
index 5385dac..5de212b 100644
--- a/web/htdocs/js/sidebar.js
+++ b/web/htdocs/js/sidebar.js
@@ -26,9 +26,8 @@ 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 contentLocation = null;
-if(contentFrameAccessible())
- var contentLocation = parent.frames[1].document.location;
+var g_orig_title = null;
+var g_content_loc = null;
//
// Sidebar styling and scrolling stuff
@@ -360,6 +359,40 @@ function contentFrameAccessible() {
}
}
+function update_content_location() {
+ // init the original frameset title
+ if (g_orig_title == null)
+ g_orig_title = window.parent.document.title;
+
+ var content_frame = window.parent.frames[1];
+
+ // 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;
+ } else {
+ var page_title = g_orig_title;
+ }
+ window.parent.document.title = page_title;
+
+ // Construct the URL to be called on page reload
+ var parts = content_frame.location.pathname.split('/')
+ parts.pop();
+ var cmk_path = parts.join('/');
+ var rel_url = content_frame.location.pathname + content_frame.location.search + content_frame.location.hash
+ var index_url = cmk_path + '/index.py?start_url=' + rel_url
+
+ if (rel_url && rel_url != 'blank') {
+ // Update the URL to be called on reload, e.g. via F5, to make the
+ // frameset switch to exactly this URL
+ window.parent.history.replaceState({}, page_title, index_url);
+
+ // only update the internal flag var if the url was not blank and has been updated
+ //otherwise try again on next scheduler run
+ g_content_loc = parent.frames[1].document.location.href;
+ }
+}
+
function debug(s) {
window.parent.frames[1].document.write(s+'<br />');
}
@@ -662,9 +695,9 @@ function sidebar_scheduler() {
// Detect page changes and re-register the mousemove event handler
// in the content frame. another bad hack ... narf
- if (contentFrameAccessible() && contentLocation != parent.frames[1].document.location) {
+ if(contentFrameAccessible() && g_content_loc != parent.frames[1].document.location.href) {
registerEdgeListeners(parent.frames[1]);
- contentLocation = parent.frames[1].document.location;
+ update_content_location();
}
setTimeout(function(){sidebar_scheduler();}, 1000);
}
diff --git a/web/htdocs/sidebar.py b/web/htdocs/sidebar.py
index 129ef6c..e653ee1 100644
--- a/web/htdocs/sidebar.py
+++ b/web/htdocs/sidebar.py
@@ -219,7 +219,8 @@ def page_side():
html.write("refresh_snapins = %r;\n" % refresh_snapins)
html.write("restart_snapins = %r;\n" % restart_snapins)
html.write("sidebar_scheduler();\n")
- html.write("window.onresize = function() { setSidebarHeight(); }\n")
+ html.write("window.onresize = function() { setSidebarHeight(); };\n")
+ html.write("if (contentFrameAccessible()) { update_content_location(); };\n")
html.write("</script>\n")
html.write("</body>\n</html>")
Module: check_mk
Branch: master
Commit: 986eda7711a02b88312eb98933b2668af682f83b
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=986eda7711a02b…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Sep 17 18:18:04 2013 +0200
FIX: fix exception and loss of hosts in a folder when deleting all site connections
---
ChangeLog | 2 ++
web/htdocs/wato.py | 5 ++++-
2 files changed, 6 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index a2b71c0..89e985e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -378,6 +378,8 @@
* FIX: fix logwatch pattern analyzer message "The host xyz is not
managed by WATO." after direct access via snapin
* FIX: Fixed first toggle of flags in global settings when default is set to True
+ * FIX: fix exception and loss of hosts in a folder when deleting all site connections
+ of a distributed WATO setup
Event Console:
* FIX: apply rewriting of application/hostname also when cancelling events
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index cbbd96f..d3f409a 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -7417,7 +7417,10 @@ def default_site():
if not "socket" in site \
or site["socket"] == "unix:" + defaults.livestatus_unix_socket:
return id
- return config.sites.keys()[0]
+ try:
+ return config.sites.keys()[0]
+ except:
+ return None
class SiteAttribute(Attribute):
def __init__(self):
Module: check_mk
Branch: master
Commit: 9073d52b23bf050a7875e0c488daf0705e317631
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9073d52b23bf05…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Tue Sep 17 18:06:07 2013 +0200
Updated bug entries #0978
---
.bugs/978 | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/.bugs/978 b/.bugs/978
new file mode 100644
index 0000000..b64fe32
--- /dev/null
+++ b/.bugs/978
@@ -0,0 +1,9 @@
+Title: list index out of range when deleting last site
+Component: wato
+State: open
+Date: 2013-09-17 18:05:17
+Targetversion: 1.4.0
+Class: nastiness
+
+Configure two sites in the Distributed Monitoring setup. Then delete
+both sites. After you delete the last one you can a WATO exception.
Module: check_mk
Branch: master
Commit: 5d7053c5bc83d4b899166e004654bfcad2b453c3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5d7053c5bc83d4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 17 16:45:19 2013 +0200
Updated bug entries #1021
---
.bugs/1021 | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/.bugs/1021 b/.bugs/1021
new file mode 100644
index 0000000..43ccfc4
--- /dev/null
+++ b/.bugs/1021
@@ -0,0 +1,10 @@
+Title: Multisite title shows only site-name (should show site alias)
+Component: multisite
+State: open
+Date: 2013-09-17 16:39:20
+Targetversion: 1.4.0
+Class: nastiness
+
+It would be more user friendly if the title of the window / tab would show
+the alias of the site instead of the site-id. The normal user does not
+see the site-id in many situations. In most cases the site-alias is used.
Module: check_mk
Branch: master
Commit: f12d77fac6affef722c2685147a31c94639694ca
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f12d77fac6affe…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Sep 17 14:05:45 2013 +0200
Do not try to execute the ldap sync after enabling but without config
---
web/plugins/userdb/ldap.py | 3 +++
1 file changed, 3 insertions(+)
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 2ed66a3..d08d00b 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -838,6 +838,9 @@ def ldap_sync(add_to_changelog, only_username):
# requests to e.g. the page hook would cause duplicate calculations
file(g_ldap_sync_time_file, 'w').write('%s\n' % time.time())
+ if not config.ldap_connection:
+ return # silently skip sync without configuration
+
# Flush ldap related before each sync to have a caching only for the
# current sync process
global g_ldap_user_cache, g_ldap_group_cache
Module: check_mk
Branch: master
Commit: bdcc4ac42574f4146d16c4df79ca23fed2a37ad3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=bdcc4ac42574f4…
Author: Götz Golla <gg(a)mathias-kettner.de>
Date: Mon Sep 16 15:04:53 2013 +0200
text of man page modified
---
checkman/check_sql | 34 ++++++++++++++--------------------
1 file changed, 14 insertions(+), 20 deletions(-)
diff --git a/checkman/check_sql b/checkman/check_sql
index e57b67d..972edab 100644
--- a/checkman/check_sql
+++ b/checkman/check_sql
@@ -4,27 +4,21 @@ catalog: agentless
license: GPL
distribution: check_mk
description:
- This is an active check that connects to a database server, sends an sql
- statement to that server, and checks for the following result:
+This is an active check that connects to a database server, sends an SQL
+statement to that server, and checks for the following result:
- The query must return two columns, a number and a text, plus
- optional performance data.
- If upper and lower levels are given, the number is being checked
- against these levels and the according state is being computed.
- Otherwise the number ist treated as a Nagios state (0,1,2,3).
- State, text and the optional performance data are being returned
+The query must return three columns, a number, a text, and
+performance data in the third column.
+If upper and lower levels are given, the number is being checked
+against these levels and the according state is being computed.
+Otherwise the number ist treated as a Nagios state (0,1,2,3).
+State, text and the performance data are being returned
- The check works with mysql, postgres and oracle databases using the
- python drivers MySQLdb, psycopg2 and cx_Oracle. For cx_oracle the
- oracle-instantclient needs to be installed as well, and the
- LD_LIBRARY_PATH needs to be modified to point to the libclntsh.so of
- that package.
-
- This check can be configured by Wato.
+The check works with MySQL, Postgresql and Oracle databases using the
+python drivers MySQLdb, psycopg2 and cx_Oracle. For cx_Oracle the
+Oracle instantclient needs to be installed as well, and the
+LD_LIBRARY_PATH needs to be modified to point to the libclntsh.so of
+that package.
perfdata:
- Optionally one value: the third field of the database response..
-
-installation:
-
-
+ One value: the third field of the database response.