Module: check_mk
Branch: master
Commit: f5267e0b4cb78567ee98dbf6c33c8342e41ece44
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f5267e0b4cb785…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Wed Feb 18 16:42:37 2015 +0100
#1995 FIX dmidecode: Fix parsing when memory devices are listed before controller
---
.werks/1995 | 10 ++++++++++
ChangeLog | 1 +
inventory/dmidecode | 29 +++++++++++++++++++++--------
3 files changed, 32 insertions(+), 8 deletions(-)
diff --git a/.werks/1995 b/.werks/1995
new file mode 100644
index 0000000..0c8fe31
--- /dev/null
+++ b/.werks/1995
@@ -0,0 +1,10 @@
+Title: dmidecode: Fix parsing when memory devices are listed before controller
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424274114
+
+
diff --git a/ChangeLog b/ChangeLog
index cb3cc0f..89715af 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -260,6 +260,7 @@
* 1855 esx_systeminfo: new inventory plugin to retrieve info about the host operating system for ESX servers
* 1851 FIX: win_exefiles: inventory check can now handle time stamps in us english locale
* 1943 FIX: inventory plugin win_os: no longer detects incorrect i386 architecture...
+ * 1995 FIX: dmidecode: Fix parsing when memory devices are listed before controller
1.2.6b1:
diff --git a/inventory/dmidecode b/inventory/dmidecode
index befa861..382875e 100644
--- a/inventory/dmidecode
+++ b/inventory/dmidecode
@@ -130,7 +130,7 @@ def inv_dmidecode_parse_system(lines):
def inv_dmidecode_parse_chassis(lines):
inv_dmidecode_parse_generic("hardware.chassis.", lines, {
"Manufacturer" : "manufacturer",
- "Type" : "type",
+ "Type" : "type",
})
# Note: This node is also being filled by lnx_cpuinfo
@@ -185,10 +185,16 @@ def inv_dmidecode_parse_processor(lines):
def inv_dmidecode_parse_physical_mem_array(lines):
# We expect several possible arrays
node = inv_tree("hardware.memory.arrays:")
- array = {
- "devices" : []
- }
- node.append(array)
+
+ # If we have a dummy entry from previous Memory Devices (see below)
+ # then we fill that entry rather than creating a new one
+ if len(node) == 1 and node[0].keys() == [ "devices" ]:
+ array = node[0]
+ else:
+ array = {
+ "devices" : []
+ }
+ node.append(array)
for line in lines:
if line[0] == "Location":
array["location"] = line[1]
@@ -200,10 +206,17 @@ def inv_dmidecode_parse_physical_mem_array(lines):
array["maximum_capacity"] = dmidecode_parse_size(line[1])
def inv_dmidecode_parse_mem_device(lines):
- # We assume that this devices belongs to an array
- # that we've just found
+ # Do we already have an entry for a memory array? Then
+ # we assume that this device belongs to the most recently
+ # read array. Otherwise we create a dummy entry and replace
+ # that later with actual information
node = inv_tree("hardware.memory.arrays:")
- array = node[-1]
+ if node:
+ array = node[-1]
+ else:
+ array = { "devices": []}
+ node.append(array)
+
device = {}
inv_dmidecode_parse_generic(device, lines, {
"Total Width" : "total_width", # 64 bits
Module: check_mk
Branch: master
Commit: 8df2ce87929e4808ca3c45e335aa988d09049f91
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8df2ce87929e48…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 18 11:41:08 2015 +0100
#1985 FIX PNP graph dashlet handles graphs in distributed setups correctly
The PNP graph dashlet now automatically detects the site a host is located
on and shows the PNP graph from this site.
---
.werks/1985 | 11 +++++++++++
ChangeLog | 1 +
web/plugins/dashboard/dashlets.py | 16 ++++++++++++++--
3 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/.werks/1985 b/.werks/1985
new file mode 100644
index 0000000..e346eba
--- /dev/null
+++ b/.werks/1985
@@ -0,0 +1,11 @@
+Title: PNP graph dashlet handles graphs in distributed setups correctly
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424255974
+
+The PNP graph dashlet now automatically detects the site a host is located
+on and shows the PNP graph from this site.
diff --git a/ChangeLog b/ChangeLog
index 1b3c767..e733719 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -201,6 +201,7 @@
* 1981 FIX: Not trying to render view in view editor when the view is not valid
* 1983 FIX: Fixed special case in language configuration via user profile...
* 1984 FIX: Fixed loosing sidebar after switching to/from edit mode in dashboard edior on page reload...
+ * 1985 FIX: PNP graph dashlet handles graphs in distributed setups correctly...
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/plugins/dashboard/dashlets.py b/web/plugins/dashboard/dashlets.py
index 28d0640..62b413e 100644
--- a/web/plugins/dashboard/dashlets.py
+++ b/web/plugins/dashboard/dashlets.py
@@ -324,17 +324,29 @@ if (has_canvas_support()) {
# '----------------------------------------------------------------------'
def make_pnp_url(dashlet, what):
- if not dashlet['context'].get('host'):
+ host = dashlet['context'].get('host')
+ if not host:
raise MKUserError('host', _('Missing needed host parameter.'))
+
service = dashlet['context'].get('service')
if not service:
service = "_HOST_"
- site = html.var('site')
+ # When the site is available via URL context, use it. Otherwise it is needed
+ # to check all sites for the requested host
+ if html.has_var('site'):
+ site = html.var('site')
+ else:
+ html.live.set_prepend_site(True)
+ query = "GET hosts\nFilter: name = %s\nColumns: name" % lqencode(host)
+ site = html.live.query_column(query)[0]
+ html.live.set_prepend_site(False)
+
if not site:
base_url = defaults.url_prefix
else:
base_url = html.site_status[site]["site"]["url_prefix"]
+
base_url += "pnp4nagios/index.php/"
var_part = "?host=%s&srv=%s&source=%d&view=%s&theme=multisite" % \
(pnp_cleanup(dashlet['context']['host']), pnp_cleanup(service),
Module: check_mk
Branch: master
Commit: d6492a3a1638b6aac4ea791ced42f9f0f78fd2ed
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d6492a3a1638b6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 18 11:30:54 2015 +0100
#1984 FIX Fixed loosing sidebar after switching to/from edit mode in dashboard edior on page reload
When switching to/from edit mode in the dashboard editor, the URL was changed from index.py?...
to dashboard.py?... which made the sidebar disappear after reloading the page manually.
---
.werks/1984 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/js/checkmk.js | 6 ++++--
web/htdocs/js/dashboard.js | 2 +-
4 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/1984 b/.werks/1984
new file mode 100644
index 0000000..2d9ac2f
--- /dev/null
+++ b/.werks/1984
@@ -0,0 +1,11 @@
+Title: Fixed loosing sidebar after switching to/from edit mode in dashboard edior on page reload
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424255344
+
+When switching to/from edit mode in the dashboard editor, the URL was changed from index.py?...
+to dashboard.py?... which made the sidebar disappear after reloading the page manually.
diff --git a/ChangeLog b/ChangeLog
index 9ed39f0..1b3c767 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -200,6 +200,7 @@
* 1980 FIX: logwatch: Fixed exception when acknowledging errors of a single logfile on a single host
* 1981 FIX: Not trying to render view in view editor when the view is not valid
* 1983 FIX: Fixed special case in language configuration via user profile...
+ * 1984 FIX: Fixed loosing sidebar after switching to/from edit mode in dashboard edior on page reload...
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/js/checkmk.js b/web/htdocs/js/checkmk.js
index 6df55e0..ff8d68c 100644
--- a/web/htdocs/js/checkmk.js
+++ b/web/htdocs/js/checkmk.js
@@ -409,8 +409,10 @@ function getUrlParam(name, url) {
* - Can add/overwrite parameters
* - Removes _* parameters
*/
-function makeuri(addvars) {
- var tmp = window.location.href.split('?');
+function makeuri(addvars, url) {
+ var url = (typeof(url) === 'undefined') ? window.location.href : url;
+
+ var tmp = url.split('?');
var base = tmp[0];
if(tmp.length > 1) {
// Remove maybe existing anchors
diff --git a/web/htdocs/js/dashboard.js b/web/htdocs/js/dashboard.js
index c18c33f..e697ddc 100644
--- a/web/htdocs/js/dashboard.js
+++ b/web/htdocs/js/dashboard.js
@@ -434,7 +434,7 @@ function toggle_dashboard_edit() {
// Only a solution for browsers with history.replaceState support. Sadly
// we have no F5/reload fix for others...
if (window.parent.history.replaceState) {
- new_url = makeuri({'edit': g_editing ? '1' : '0'});
+ new_url = makeuri({'edit': g_editing ? '1' : '0'}, window.parent.location.href);
window.parent.history.replaceState({}, document.title, new_url);
}
Module: check_mk
Branch: master
Commit: 8eb8fa95d094e41372a440cec7c4c5fd6a590375
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=8eb8fa95d094e4…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Feb 18 08:15:39 2015 +0100
#1983 FIX Fixed special case in language configuration via user profile
When a user explicitly configured "english" as language in it's user
profile, this setting was not saved correctly. Instead the former
configured language or the default configured language was selected
again after saving.
---
.werks/1983 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/forms.py | 4 ++--
web/htdocs/wato.py | 35 ++++++++++++++++-------------------
web/plugins/userdb/hook_auth.py | 11 ++++++++---
5 files changed, 40 insertions(+), 24 deletions(-)
diff --git a/.werks/1983 b/.werks/1983
new file mode 100644
index 0000000..9737070
--- /dev/null
+++ b/.werks/1983
@@ -0,0 +1,13 @@
+Title: Fixed special case in language configuration via user profile
+Level: 1
+Component: multisite
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1424243612
+
+When a user explicitly configured "english" as language in it's user
+profile, this setting was not saved correctly. Instead the former
+configured language or the default configured language was selected
+again after saving.
diff --git a/ChangeLog b/ChangeLog
index 56da789..9ed39f0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -199,6 +199,7 @@
* 1978 FIX: Fixed linking to other views using "joined columns"...
* 1980 FIX: logwatch: Fixed exception when acknowledging errors of a single logfile on a single host
* 1981 FIX: Not trying to render view in view editor when the view is not valid
+ * 1983 FIX: Fixed special case in language configuration via user profile...
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/htdocs/forms.py b/web/htdocs/forms.py
index 7a7c392..28119c6 100644
--- a/web/htdocs/forms.py
+++ b/web/htdocs/forms.py
@@ -220,8 +220,8 @@ def section(title = None, checkbox = None, id = "", simple=False, hide = False,
if type(checkbox) == str:
html.write(checkbox)
else:
- name, inactive, attrname = checkbox
- html.checkbox(name, inactive, onclick = 'wato_toggle_attribute(this, \'%s\')' % attrname)
+ name, active, attrname = checkbox
+ html.checkbox(name, active, onclick = 'wato_toggle_attribute(this, \'%s\')' % attrname)
html.write('</div>')
html.write('</td>')
html.write('<td class="content%s">' % (simple and " simple" or ""))
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 1350a49..e750609 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -11991,9 +11991,9 @@ def mode_edit_user(phase):
roles.keys())
# Language configuration
- set_lang = html.var('_set_lang')
+ set_lang = html.get_checkbox('_set_lang')
language = html.var('language')
- if set_lang and language != config.default_language:
+ if set_lang:
if language == '':
language = None
new_user['language'] = language
@@ -12272,7 +12272,7 @@ def mode_edit_user(phase):
custom_user_attributes('notify')
forms.header(_("Personal Settings"), isopen = False)
- select_language(user.get('language', ''))
+ select_language(user)
custom_user_attributes('personal')
# TODO: Later we could add custom macros here, which
@@ -15676,20 +15676,16 @@ def verify_password_policy(password):
'set a password which uses at least %d of them.') % num_groups)
-def select_language(user_language):
+def select_language(user):
languages = [ l for l in get_languages() if not config.hide_language(l[0]) ]
- inactive = not not user_language
-
if languages:
- forms.section(_("Language"),
- checkbox = ('_set_lang', inactive, 'language'))
- # html.checkbox('_set_lang', inactive, onclick = 'wato_toggle_attribute(this, \'language\')')
- # html.write(" ")
+ active = 'language' in user
+ forms.section(_("Language"), checkbox = ('_set_lang', active, 'language'))
default_label = _('Default: %s') % (get_language_alias(config.default_language) or _('English'))
html.write('<div class="inherited" id="attr_default_language" style="%s">%s</div>' %
- (inactive and "display: none" or "", default_label))
- html.write('<div id="attr_entry_language" style="%s">' % ((not inactive) and "display: none" or ""))
- html.select("language", languages, user_language)
+ ((active) and "display: none" or "", default_label))
+ html.write('<div id="attr_entry_language" style="%s">' % ((not active) and "display: none" or ""))
+ html.select("language", languages, user.get('language') or '')
html.write("</div>")
html.help(_('Configure the default language '
'to be used by the user in the user interface here. If you do not check '
@@ -15774,16 +15770,16 @@ def page_user_profile(change_pw=False):
success = None
if html.has_var('_save') and html.check_transaction():
- try:
- users = userdb.load_users(lock = True)
+ users = userdb.load_users(lock = True)
+ try:
# Profile edit (user options like language etc.)
if config.may('general.edit_profile'):
if not change_pw:
- set_lang = html.var('_set_lang')
+ set_lang = html.get_checkbox('_set_lang')
language = html.var('language')
# Set the users language if requested
- if set_lang and language != config.get_language():
+ if set_lang:
if language == '':
language = None
# Set custom language
@@ -15863,6 +15859,8 @@ def page_user_profile(change_pw=False):
success = True
except MKUserError, e:
html.add_user_error(e.varname, e.message)
+ else:
+ users = userdb.load_users()
# When in distributed setup, display the replication dialog instead of the normal
# profile edit dialog after changing the password.
@@ -15905,7 +15903,6 @@ def page_user_profile(change_pw=False):
if html.has_user_errors():
html.show_user_errors()
- users = userdb.load_users()
user = users.get(config.user_id)
if user == None:
html.show_warning(_("Sorry, your user account does not exist."))
@@ -15937,7 +15934,7 @@ def page_user_profile(change_pw=False):
html.password_input('password2', autocomplete = "off")
if not change_pw and config.may('general.edit_profile'):
- select_language(config.get_language(''))
+ select_language(user)
# Let the user configure how he wants to be notified
if not rulebased_notifications \
diff --git a/web/plugins/userdb/hook_auth.py b/web/plugins/userdb/hook_auth.py
index fc34447..d57d1c7 100644
--- a/web/plugins/userdb/hook_auth.py
+++ b/web/plugins/userdb/hook_auth.py
@@ -89,9 +89,12 @@ def format_php(data, lvl = 1):
def create_php_file(callee, users, role_permissions, groups, folder_permissions):
+ # Do not change WATO internal objects
+ nagvis_users = copy.deepcopy(users)
+
# Set a language for all users
- for username in users:
- users[username].setdefault('language', config.default_language)
+ for user in nagvis_users.values():
+ user.setdefault('language', config.default_language)
# need an extra lock file, since we move the auth.php.tmp file later
# to auth.php. This move is needed for not having loaded incomplete
@@ -224,7 +227,9 @@ function permitted_maps($username) {
}
?>
-''' % (callee, format_php(users), format_php(role_permissions), format_php(groups), format_php(folder_permissions)))
+''' % (callee, format_php(nagvis_users), format_php(role_permissions),
+ format_php(groups), format_php(folder_permissions)))
+
# Now really replace the file
os.rename(tempfile, g_auth_base_dir + '/auth.php')