Module: check_mk
Branch: master
Commit: b6f0f98410079bc7b852e42c1b931542831fddf3
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b6f0f98410079b…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Jun 18 10:03:00 2014 +0200
FIX Reducing size of auth.php (needed for authorisation in NagVis) in large environments
In environments with a large user base or a large folder structure, the auth.php file which
is being generated while modifying users, roles and activating the pending changes, the file
could get very large. This change reduces the size of the file in such a case dramatically.
---
.werks/821 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 18 +++++++++++++-----
web/plugins/userdb/hook_auth.py | 9 ++++++++-
4 files changed, 32 insertions(+), 6 deletions(-)
diff --git a/.werks/821 b/.werks/821
new file mode 100644
index 0000000..44c60ac
--- /dev/null
+++ b/.werks/821
@@ -0,0 +1,10 @@
+Title: Reducing size of auth.php (needed for authorisation in NagVis) in large environments
+Level: 1
+Component: wato
+Version: 1.2.5i4
+Date: 1403078473
+Class: fix
+
+In environments with a large user base or a large folder structure, the auth.php file which
+is being generated while modifying users, roles and activating the pending changes, the file
+could get very large. This change reduces the size of the file in such a case dramatically.
diff --git a/ChangeLog b/ChangeLog
index 45beef1..a7b0e3f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
* 0987 New button for updating DNS cache...
* 0813 FIX: LDAP: Improved slightly missleading logging of LDAP sync actions...
* 0935 FIX: CPU utilization: increased maximum value to 10000...
+ * 0821 FIX: Reducing size of auth.php (needed for authorisation in NagVis) in large environments...
Reporting & Availability:
* 0985 Availability: display phases of freqent state changes as "chaos"...
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 04ec06d..edf2644 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -1060,12 +1060,20 @@ def get_folder_permissions_of_users(users):
users = userdb.load_users()
for username in users.iterkeys():
- permissions[username] = {}
+ perms = {}
for folder_path, folder in folders.iteritems():
- permissions[username][folder_path] = {
- 'read': check_folder_permissions(folder, 'read', False, username, users) == True,
- 'write': check_folder_permissions(folder, 'write', False, username, users) == True,
- }
+ readable = check_folder_permissions(folder, 'read', False, username, users) == True
+ writable = check_folder_permissions(folder, 'write', False, username, users) == True
+
+ if readable or writable:
+ perms[folder_path] = {}
+ if readable:
+ perms[folder_path]['read'] = True
+ if writable:
+ perms[folder_path]['write'] = True
+
+ if perms:
+ permissions[username] = perms
return permissions
def check_folder_permissions(folder, how, exception=True, user = None, users = None):
diff --git a/web/plugins/userdb/hook_auth.py b/web/plugins/userdb/hook_auth.py
index 15392c6..771807c 100644
--- a/web/plugins/userdb/hook_auth.py
+++ b/web/plugins/userdb/hook_auth.py
@@ -112,7 +112,14 @@ function get_folder_permissions($username) {
if(!isset($mk_folders[$username])) {
return array();
} else {
- return $mk_folders[$username];
+ $permissions = $mk_folders[$username];
+ foreach ($permissions as $folder => $perms) {
+ if (!isset($perms['read']))
+ $perms['read'] = false;
+ elseif (!isset($perms['write']))
+ $perms['write'] = false;
+ }
+ return $permissions;
}
}
Module: check_mk
Branch: master
Commit: 52b1551207457c036e5584253ea500d7f74180fa
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=52b1551207457c…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Jun 16 15:42:42 2014 +0200
Updated bug entries #2129, #2130, #2131
---
.bugs/2129 | 10 ++++++++++
.bugs/2130 | 9 +++++++++
.bugs/2131 | 9 +++++++++
3 files changed, 28 insertions(+)
diff --git a/.bugs/2129 b/.bugs/2129
new file mode 100644
index 0000000..b0f0873
--- /dev/null
+++ b/.bugs/2129
@@ -0,0 +1,10 @@
+Title: check_dns: Multiple expected IP addresses can be set in two ways
+Component: wato
+State: open
+Date: 2014-06-16 15:36:50
+Targetversion: 1.2.5i1
+Class: bug
+
+The check accept either multiple "-a <host>" or "-a <host1>,<host2>. This depends on the
+way you want the check to work. Either expect all of the addresses to be part of the
+answer or just one of the given ones.
diff --git a/.bugs/2130 b/.bugs/2130
new file mode 100644
index 0000000..dd94b0f
--- /dev/null
+++ b/.bugs/2130
@@ -0,0 +1,9 @@
+Title: Dynamic file system levels can not be edited
+Component: wato
+State: open
+Date: 2014-06-16 15:38:54
+Targetversion: 1.2.5i1
+Class: bug
+
+When a df rule has dynamic file system levels configured, this is saved and can be used, but when
+opened in WATO again, the value can not be loaded again.
diff --git a/.bugs/2131 b/.bugs/2131
new file mode 100644
index 0000000..c46c32b
--- /dev/null
+++ b/.bugs/2131
@@ -0,0 +1,9 @@
+Title: Sorting views in dashlets, breaks layout
+Component: multisite
+State: open
+Date: 2014-06-16 15:40:12
+Targetversion: 1.2.5i1
+Class: bug
+
+When a view is sorted within a dashlet, the display_options seem to be mixed. Suddenly the view header
+is visible.
Module: check_mk
Branch: master
Commit: ad76301dd9d73e61646b571af286c6a2648000ce
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ad76301dd9d73e…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Mon Jun 16 12:32:39 2014 +0200
man page more detailed, default levels included, plus minor code cleanup
---
checkman/adva_fsp_temp | 43 +++++++++++++++++++++++++++++++++++++++++--
checks/adva_fsp_temp | 12 +++++++++---
2 files changed, 50 insertions(+), 5 deletions(-)
diff --git a/checkman/adva_fsp_temp b/checkman/adva_fsp_temp
index d4ae755..eb2a477 100644
--- a/checkman/adva_fsp_temp
+++ b/checkman/adva_fsp_temp
@@ -7,12 +7,12 @@ description:
This checks monitors the temperature of ports and modules of the Adva
FSP 3000 scalable optical transport solution.
- No limits are set for the temperatur , since limits are configured in the
+ No limits are set for the temperature, since limits are configured in the
device itself. The upper and lower limits for the temperature are
read from the device. If the current value is outside the allowed
range the check is {CRIT}, otherwise it is {OK}.
- In addition temperature trends are monitored by the check. If the rate of
+ In addition {temperature trends} are monitored by the check. If the rate of
temperature increase is above a configured rate per configured time range,
the check becomes {WARN} or {CRIT}. The check can also predict in which
period of time the upper limit for the temperature configured on the device
@@ -27,3 +27,42 @@ perfdata:
inventory:
All temperature sensors on all modules/ports are detected
+
+examples:
+ # Set levels via dictionary, old check_mk syntax
+ check_parameters = [
+ ( {'trend_range': 60,
+ 'trend_c': (1, 5),
+ 'trend_timeleft': (1000, 500)
+ }, [], ALL_HOSTS, [ "PL" ] )
+ ]
+
+ # set levels via wato syntax:
+ checkgroup_parameters.setdefault('temperature_trends', [])
+
+ checkgroup_parameters['temperature_trends'] = [
+ ( {'trend_c': (1, 5), 'trend_timeleft': (1000, 500), 'trend_range': 60}, [], ALL_HOSTS, ALL_SERVICES ),
+ ] + checkgroup_parameters['temperature_trends']
+
+ # set default values
+ adva_fsp_temp_default_levels = {
+ # range in minutes, default is no trend computation
+ 'trend_range': None,
+ 'trend_c': (1, 5),
+ 'trend_timeleft': (240, 120),
+ }
+
+[parameters]
+parameters (dict): a dictionary containing the parameters for the trend
+ computation with the following keys:
+
+ {"trend_range"}: The time range in minutes over which trends are computed.
+ If you set this to None then trend computing is disabled and the check
+ outputs only one performance data value.
+
+ {"trend_c"}: A tuple of numbers specifying limits for the temperature increase
+ in degrees Celcius within the configured time range
+
+ {"trend_timeleft"}: A tuple of numbers specifying the minimum time in minutes
+ left before the temperature limit is reached
+
diff --git a/checks/adva_fsp_temp b/checks/adva_fsp_temp
index dad5b47..0463ad5 100644
--- a/checks/adva_fsp_temp
+++ b/checks/adva_fsp_temp
@@ -24,13 +24,18 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
+adva_fsp_temp_default_levels = {
+ "trend_range": None, # range in minutes, default is no trend computation
+ "trend_c": (5,10), # in degrees Celcius
+ "trend_timeleft": (240, 120), # in minutes
+}
+
def inventory_adva_fsp_temp(info):
inventory = []
for line in info:
# Ignore unconnected sensors
- #if len(line) == 5 and line[4] != "" and line[3] != "" and int(line[0]) >= -2730:
if len(line) == 5 and line[0] != "" and line[4] != "" and int(line[0]) >= -2730:
- inventory.append( (line[4], None) )
+ inventory.append( (line[4], "adva_fsp_temp_default_levels") )
return inventory
def check_adva_fsp_temp(item, params, info):
@@ -86,7 +91,7 @@ def check_adva_fsp_temp(item, params, info):
else:
wa, cr = None, None
- # compute time until filesystem is full (only for positive trend, of course)
+ # compute time until temperature limit is reached (only for positive trend, of course)
# The start value of minutes_left is negative. The pnp graph and the perfometer
# will interpret this as inifinite -> not growing
minutes_left = -1
@@ -126,6 +131,7 @@ check_info['adva_fsp_temp'] = {
"check_function" : check_adva_fsp_temp,
"service_description" : "Temperature %s",
"has_perfdata" : True,
+ "default_levels_variable" : "adva_fsp_temp_default_levels",
"snmp_info" : ( ".1.3.6.1.4.1.2544", [
"1.11.2.4.2.1.1.1", # moduleDiagnosticsTemp
"1.11.2.4.2.1.1.2", # moduleDiagnosticsUpperTempThres