Module: check_mk
Branch: master
Commit: 1dae3efa68c2cf94689342bb6b2fa317a0007bf0
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=1dae3efa68c2cf…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 9 14:37:50 2013 +0100
FIX: Increased performance of multisite GUI with a large userbase
---
.werks/307 | 4 +++-
ChangeLog | 2 +-
web/htdocs/login.py | 10 +++++-----
web/htdocs/userdb.py | 6 ++++++
4 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/.werks/307 b/.werks/307
index 3648423..6cb3aa1 100644
--- a/.werks/307
+++ b/.werks/307
@@ -5,4 +5,6 @@ Version: 1.2.3i8
Date: 1386595064
Class: fix
-
+The processing performance of each multisite page might decrease
+when having a large amount of users. This commit tries to reduce
+the time taken by processing the user information.
diff --git a/ChangeLog b/ChangeLog
index 47582d4..baac9e6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,7 +8,7 @@
Multisite:
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
- * 0307 FIX: Increased performance of multisite GUI with a large userbase
+ * 0307 FIX: Increased performance of multisite GUI with a large userbase...
WATO:
* 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
diff --git a/web/htdocs/login.py b/web/htdocs/login.py
index 5f691c3..c3a06e0 100644
--- a/web/htdocs/login.py
+++ b/web/htdocs/login.py
@@ -67,9 +67,10 @@ def load_secret():
# Load the password serial of the user. This serial identifies the current config
# state of the user account. If either the password is changed or the account gets
# locked the serial is increased and all cookies get invalidated.
-def load_serial(user_id):
- users = userdb.load_users()
- return users.get(user_id, {}).get('serial', 0)
+# Better use the value from the "serials.mk" file, instead of loading the whole
+# user database via load_users() for performance reasons.
+def load_serial(username):
+ return userdb.load_custom_attr(username, 'serial', saveint, 0)
# Generates the hash to be added into the cookie value
def generate_hash(username, now, serial):
@@ -105,8 +106,7 @@ def check_auth_cookie(cookie_name):
# del_auth_cookie()
# return ''
- users = userdb.load_users().keys()
- if not username in users:
+ if not userdb.user_exists(username):
raise MKAuthException(_('Username is unknown'))
# Validate the hash
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index 7808dc9..43ad80b 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -117,6 +117,12 @@ def create_non_existing_user(connector_id, username):
# Call the sync function for this new user
hook_sync(connector_id = connector_id, only_username = username)
+# FIXME: Can we improve this easily? Would be nice not to have to call "load_users".
+# Maybe a directory listing of profiles or a list of a small file would perform better
+# than having to load the users, contacts etc. during each http request to multisite
+def user_exists(username):
+ return username in load_users().keys()
+
def user_locked(username):
users = load_users()
return users[username].get('locked', False)
Module: check_mk
Branch: master
Commit: 824a1ce1f1524ddf724ee903edc0bb6b7c06e435
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=824a1ce1f1524d…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Mon Dec 9 14:09:24 2013 +0100
FIX mssql: Server instances with underline in name are now supported.
Thanks to a patch from H.Schniggendiller
---
.werks/104 | 8 ++++++++
ChangeLog | 1 +
agents/windows/plugins/mssql.vbs | 21 ++++++++++++---------
3 files changed, 21 insertions(+), 9 deletions(-)
diff --git a/.werks/104 b/.werks/104
new file mode 100644
index 0000000..c306f80
--- /dev/null
+++ b/.werks/104
@@ -0,0 +1,8 @@
+Title: mssql: Server instances with underline in name are now supported.
+Level: 1
+Component: checks
+Version: 1.2.3i8
+Date: 1386594495
+Class: fix
+
+Thanks to a patch from H.Schniggendiller
diff --git a/ChangeLog b/ChangeLog
index 72ef6c3..fd86410 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
* 0305 FIX: apache_status: Fixed exception when agent reports HTML code as apache-status data...
+ * 0104 FIX: mssql: Server instances with underline in name are now supported....
Multisite:
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
diff --git a/agents/windows/plugins/mssql.vbs b/agents/windows/plugins/mssql.vbs
index b9fc1c9..7f508ff 100644
--- a/agents/windows/plugins/mssql.vbs
+++ b/agents/windows/plugins/mssql.vbs
@@ -17,11 +17,13 @@
'
' This check has been developed with MSSQL Server 2008 R2. It should work with
' older versions starting from at least MSSQL Server 2005.
+'
+' 16.10.2013 Instanzen mit Unterstrich im Namen -- H.Schniggendiller
' -----------------------------------------------------------------------------
Option Explicit
-Dim WMI, prop, instId, instVersion, instIds, instName, output, WMIservice, colRunningServices, objService
+Dim WMI, prop, instId, instIdx, instVersion, instIds, instName, output, WMIservice, colRunningServices, objService
WScript.Timeout = 10
@@ -71,11 +73,11 @@ For Each prop In WMI.ExecQuery("SELECT * FROM SqlServiceAdvancedProperty WHERE "
Set colRunningServices = WMIservice.ExecQuery("SELECT State FROM Win32_Service WHERE Name = '" & prop.ServiceName & "'")
- instId = Replace(prop.ServiceName, "$", "_")
+ instId = Replace(prop.ServiceName, "$", "__")
instVersion = prop.PropertyStrValue
-
+ instIdx = Replace(instId, "__", "_")
addOutput( "<<<mssql_versions>>>" )
- addOutput( instId & " " & instVersion )
+ addOutput( instIdx & " " & instVersion )
' Now query the server instance for the databases
' Use name as key and always empty value for the moment
@@ -106,9 +108,10 @@ For Each instId In instIds.Keys
' At this place one could implement to use other authentication mechanism
CONN.Properties("Integrated Security").Value = "SSPI"
- If InStr(instId, "_") <> 0 Then
- instName = Split(instId, "_")(1)
- Else
+ If InStr(instId, "__") <> 0 Then
+ instName = Split(instId, "__")(1)
+ instId = Replace(instId, "__", "_")
+ Else
instName = instId
End If
@@ -117,7 +120,8 @@ For Each instId In instIds.Keys
CONN.Properties("Data Source").Value = "(local)"
Else
CONN.Properties("Data Source").Value = hostname & "\" & instName
- End If
+ End If
+ 'WScript.echo (CONN)
CONN.Open
@@ -217,4 +221,3 @@ Set CONN = nothing
' finally output collected data
WScript.echo output
-
Module: check_mk
Branch: master
Commit: 73817857ac4823dca6fd301f6bc8954637bec5f7
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=73817857ac4823…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Mon Dec 9 14:04:39 2013 +0100
FIX Fixed incorrect html formatting when displaying host or service comments
The comment icon in a multisite view was not drawn correctly whenever
a comment for this host or service had a single quote.
---
.werks/239 | 9 +++++++++
ChangeLog | 1 +
web/plugins/icons/builtin.py | 1 +
3 files changed, 11 insertions(+)
diff --git a/.werks/239 b/.werks/239
new file mode 100644
index 0000000..40b6bef
--- /dev/null
+++ b/.werks/239
@@ -0,0 +1,9 @@
+Title: Fixed incorrect html formatting when displaying host or service comments
+Level: 1
+Component: multisite
+Version: 1.2.3i8
+Date: 1386594095
+Class: fix
+
+The comment icon in a multisite view was not drawn correctly whenever
+a comment for this host or service had a single quote.
diff --git a/ChangeLog b/ChangeLog
index 126a657..72ef6c3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
Multisite:
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
+ * 0239 FIX: Fixed incorrect html formatting when displaying host or service comments...
WATO:
* 0057 FIX: Fix exception in WATO host editor on custom tag without topic...
diff --git a/web/plugins/icons/builtin.py b/web/plugins/icons/builtin.py
index ee90cf1..4bcfc7f 100644
--- a/web/plugins/icons/builtin.py
+++ b/web/plugins/icons/builtin.py
@@ -380,6 +380,7 @@ def paint_comments(what, row, tags, custom_vars):
text = ""
for c in comments:
id, author, comment, ty, timestamp = c
+ comment = comment.replace("\n", "<br>").replace("'","'")
text += "%s %s: \"%s\" \n" % (paint_age(timestamp, True, 0, 'abs')[1], author, comment)
return link_to_view('<img class=icon title=\'%s\' ' \
'src="images/icon_comment.gif">' %
Module: check_mk
Branch: master
Commit: 9cb2388bdb560ea57e3f468569a34e02ecc7360d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=9cb2388bdb560e…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 9 10:31:19 2013 +0100
FIX apache_status: Fixed exception when agent reports HTML code as apache-status data
When the apache-status module is not enabled or the webserver is somehow missconfigured,
the agents HTTP request to the apache-status URL might return HTML code instead of the
expected textual response. Added code to detect HTML code and skip the webserver instance
in this case.
---
.werks/305 | 11 +++++++++++
ChangeLog | 1 +
agents/plugins/apache_status | 5 ++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/305 b/.werks/305
new file mode 100644
index 0000000..9bacd05
--- /dev/null
+++ b/.werks/305
@@ -0,0 +1,11 @@
+Title: apache_status: Fixed exception when agent reports HTML code as apache-status data
+Level: 1
+Component: checks
+Version: 1.2.3i8
+Date: 1386581355
+Class: fix
+
+When the apache-status module is not enabled or the webserver is somehow missconfigured,
+the agents HTTP request to the apache-status URL might return HTML code instead of the
+expected textual response. Added code to detect HTML code and skip the webserver instance
+in this case.
diff --git a/ChangeLog b/ChangeLog
index 1a67109..89a7192 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,7 @@
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
+ * 0305 FIX: apache_status: Fixed exception when agent reports HTML code as apache-status data...
Multisite:
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in Chrome/IE
diff --git a/agents/plugins/apache_status b/agents/plugins/apache_status
index 79d9de3..f2bd8fa 100755
--- a/agents/plugins/apache_status
+++ b/agents/plugins/apache_status
@@ -20,7 +20,7 @@
import os, sys, urllib2, re
-config_dir = os.getenv("MK_CONFDIR", "/etc/check_mk")
+config_dir = os.getenv("MK_CONFDIR", "/etc/check_mk")
config_file = config_dir + "/apache_status.conf"
if not os.path.exists(config_file):
config_file = config_dir + "/apache_status.cfg"
@@ -116,6 +116,9 @@ for server in servers:
for line in fd.read().split('\n'):
if not line.strip():
continue
+ if line.lstrip()[0] == '<':
+ # seems to be html output. Skip this server.
+ break
print address, port, line
except urllib2.HTTPError, e:
sys.stderr.write('HTTP-Error (%s:%d): %s %s\n' % (address, port, e.code, e))
Module: check_mk
Branch: master
Commit: 17a62af3595bc00c8dc0d595855b768d1e748b79
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=17a62af3595bc0…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Dec 9 11:08:47 2013 +0100
Updated bug entries #2095
---
.bugs/2095 | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/.bugs/2095 b/.bugs/2095
new file mode 100644
index 0000000..734b2f0
--- /dev/null
+++ b/.bugs/2095
@@ -0,0 +1,13 @@
+Title: Add mechanism to cleanup a users profile
+Component: multisite
+State: open
+Date: 2013-12-09 11:06:47
+Targetversion: 1.2.3i6
+Class: feature
+
+below var/check_mk/web/<user>/, there are several files being created during
+working with multisite. For example the file sidebar.mk is being created once
+the user starts customizing the sidebar. It should be possible to remove the
+customized sidebar to use the default sidebar again.
+
+Same for other files like buttoncounts, treestates, view options, ...