Module: check_mk
Branch: master
Commit: dc0ed31a00ec0b5e54c3614d58e8a73ddedf5668
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=dc0ed31a00ec0b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Aug 6 20:06:54 2014 +0200
#1153 FIX Changed custom user attributes can now be used immediately
IN previous versions changed custom user attributes needed a restart of the
apache process to take effect.
---
.bugs/1089 | 7 +++++--
.bugs/841 | 7 +++++--
.werks/1153 | 11 +++++++++++
ChangeLog | 1 +
web/htdocs/userdb.py | 18 +++++++++++++++---
web/plugins/userdb/ldap.py | 16 ++++++++++++++--
6 files changed, 51 insertions(+), 9 deletions(-)
diff --git a/.bugs/1089 b/.bugs/1089
index d3d094f..1f80319 100644
--- a/.bugs/1089
+++ b/.bugs/1089
@@ -1,10 +1,13 @@
Title: New user custom attribute needs apache restart to work
Component: wato
-State: open
+Class: bug
+State: done
Date: 2014-01-30 15:14:42
Targetversion: 1.2.5i1
-Class: bug
If you create a new custom attribute for users then you
need to restart Apache in order to make that attribute visible
in the WATO pages.
+
+2014-08-06 20:05:19: changed state open -> done
+Changed custom attributes are now instantly visible on user profile page and ldap sync plugin configuration
diff --git a/.bugs/841 b/.bugs/841
index 3bed1c3..21f2bdf 100644
--- a/.bugs/841
+++ b/.bugs/841
@@ -1,8 +1,11 @@
Title: View Editor: It's not possible to delete a view
Component: multisite
-State: open
+Class: bug
+State: done
Date: 2014-04-16 09:34:07
Targetversion: 1.2.5i1
-Class: bug
Currently it is not possible to delete a view in Multisite. I think this has to do with the new security features regarding to the CVE's
+
+2014-08-06 19:22:15: changed state open -> done
+Has already been fixed.
diff --git a/.werks/1153 b/.werks/1153
new file mode 100644
index 0000000..0f4f8f9
--- /dev/null
+++ b/.werks/1153
@@ -0,0 +1,11 @@
+Title: Changed custom user attributes can now be used immediately
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.5i6
+Date: 1407348323
+Class: fix
+
+IN previous versions changed custom user attributes needed a restart of the
+apache process to take effect.
+
diff --git a/ChangeLog b/ChangeLog
index bdb0be4..e9c18d5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -31,6 +31,7 @@
* 1091 FIX: logwatch patterns: allow unicode text in pattern comment
* 1092 FIX: logwatch: now able to enter unicode text into the "Pattern (Regex)" field
* 0191 FIX: Added swp files to the ignore list for the WATO git feature...
+ * 1153 FIX: Changed custom user attributes can now be used immediately...
1.2.5i5:
diff --git a/web/htdocs/userdb.py b/web/htdocs/userdb.py
index d0dc871..197e04b 100644
--- a/web/htdocs/userdb.py
+++ b/web/htdocs/userdb.py
@@ -34,9 +34,19 @@ loaded_with_language = False
# Custom user attributes
user_attributes = {}
+builtin_user_attribute_names = []
-# Load all login plugins
+# Load all userdb plugins
def load_plugins():
+ # Do not cache the custom user attributes. They can be created by the user
+ # during runtime, means they need to be loaded during each page request.
+ # But delete the old definitions before to also apply removals of attributes
+ if user_attributes:
+ for attr_name in user_attributes.keys():
+ if attr_name not in builtin_user_attribute_names:
+ del user_attributes[attr_name]
+ declare_custom_user_attrs()
+
global loaded_with_language
if loaded_with_language == current_language:
return
@@ -45,10 +55,12 @@ def load_plugins():
global user_attributes ; user_attributes = {}
global multisite_user_connectors ; multisite_user_connectors = []
- declare_custom_user_attrs()
-
load_web_plugins("userdb", globals())
+ global builtin_user_attribute_names
+ builtin_user_attribute_names = user_attributes.keys()
+ declare_custom_user_attrs()
+
# This must be set after plugin loading to make broken plugins raise
# exceptions all the time and not only the first time (when the plugins
# are loaded).
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index e4ec3e7..0b555b0 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -833,6 +833,11 @@ ldap_attribute_plugins['pager'] = {
# Register sync plugins for all custom user attributes (assuming simple data types)
def register_user_attribute_sync_plugins():
+ # Remove old user attribute plugins
+ for attr_name in ldap_attribute_plugins.keys():
+ if attr_name not in ldap_builtin_attribute_plugin_names:
+ del ldap_attribute_plugins[attr_name]
+
for attr, val in get_user_attributes():
ldap_attribute_plugins[attr] = {
'title': val['valuespec'].title(),
@@ -851,8 +856,6 @@ def register_user_attribute_sync_plugins():
],
}
-register_user_attribute_sync_plugins()
-
def ldap_convert_groups_to_contactgroups(plugin, params, user_id, ldap_user, user):
# 1. Fetch all existing group names in WATO
cg_names = load_group_information().get("contact", {}).keys()
@@ -1107,6 +1110,8 @@ def ldap_non_contact_attributes():
attrs.update(ldap_attribute_plugins.get(key, {}).get('non_contact_attributes', []))
return list(attrs)
+ldap_builtin_attribute_plugin_names = []
+
# Is called on every multisite http request
def ldap_page():
try:
@@ -1114,6 +1119,13 @@ def ldap_page():
except:
last_sync_time = 0
+ # Save the builtin attribute names (to be able to delete removed user attributes)
+ global ldap_builtin_attribute_plugin_names
+ if not ldap_builtin_attribute_plugin_names:
+ ldap_builtin_attribute_plugin_names = ldap_attribute_plugins.keys()
+
+ register_user_attribute_sync_plugins()
+
# in case of sync problems, synchronize all 20 seconds, instead of the configured
# regular cache livetime
if os.path.exists(g_ldap_sync_fail_file):
Module: check_mk
Branch: master
Commit: fb112d6af1b39086526213acc8f89b23b1c9cae3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=fb112d6af1b390…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Aug 6 14:03:18 2014 +0200
raritan_pdu_inlet: Fixed wrong sensor state
---
checks/raritan_pdu_inlet | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/checks/raritan_pdu_inlet b/checks/raritan_pdu_inlet
index 000d861..736329c 100644
--- a/checks/raritan_pdu_inlet
+++ b/checks/raritan_pdu_inlet
@@ -26,7 +26,7 @@
def raritan_pdu_inlet_convert(info):
# List of tuples, sorting like the snmp output,
- # each tuple contains: capabilities, Unit, digits
+ # each tuple contains: capabilities, digits
translation = (
( '2', 1 ),
( '1', 0 ),
@@ -37,9 +37,11 @@ def raritan_pdu_inlet_convert(info):
)
phases = [ 'L1', 'L2', 'L3' ]
i = 0
+ state = 4 # We dont know the senosr state, so we assume normal
for line in info:
y = 0
- state = line[1]
+ # loop over the current Sensor values.
+ # We know the units cause of the translation list
for value in line[1:]:
item = phases[i] + '-' + capabilities[translation[y][0]]
unit = translation[y][0]
Module: check_mk
Branch: master
Commit: 3d607501efb2862c0e468e32690841f06fd76820
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=3d607501efb286…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Aug 5 17:00:01 2014 +0200
cisco_temp_sensor: missing changes for werk 198
---
.werks/198 | 5 ++++-
checks/cisco_temp_sensor | 7 +++++++
2 files changed, 11 insertions(+), 1 deletion(-)
diff --git a/.werks/198 b/.werks/198
index b22d797..419ee24 100644
--- a/.werks/198
+++ b/.werks/198
@@ -1,9 +1,12 @@
Title: cisco_temp_sensor: Removed dicey detection for temperature value.
Level: 1
Component: checks
-Compatible: incomp
+Compatible: compa
Version: 1.2.5i6
Date: 1407250309
Class: fix
+Cause of a dicey detection, also values who are not given in tens of degrees became divided by ten.
+This werk tryes to fix this
+
diff --git a/checks/cisco_temp_sensor b/checks/cisco_temp_sensor
index c6742f4..4a0affa 100644
--- a/checks/cisco_temp_sensor
+++ b/checks/cisco_temp_sensor
@@ -145,6 +145,13 @@ def check_cisco_temp_sensor(item, _no_params, info):
for id, descr, sensortype, value, sensorstate, levels in sensors:
if item == descr:
warn, crit = levels[0:2]
+ # poor try to find temperature values
+ # who are given in tens of degress.
+ # Seems that some new firmware show this behavier.
+ # A normal Temperature Sensor has only a range up to
+ # 60 degree, so i choiced 70.
+ if value > 70:
+ value = value / 10
if sensorstate == "2":
return (3, "data from sensor currently not available")
elif sensorstate == "3":