Changed default thresholds to WARN on the first broken disk, CRIT on 50%
Message-ID: <5512a1fb.eDGTW+6a0KC3+qmY%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: d83e023eeabb4a73f199d58123c85231517f0a67
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d83e023eeabb4a…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Mar 25 12:54:30 2015 +0100
#2159 FIX netapp_api_disk.summary: Changed default thresholds to WARN on the first broken disk, CRIT on 50%
The thresholds are configured using percentage levels on the broken to spare disk ratio.
Previous versions of the check simply did not apply levels on the number of broken disks
except you configured the ratio. We have added a default ratio of 1% for WARN and 50% for
CRIT.
---
.werks/2159 | 13 +++++++++++++
ChangeLog | 1 +
checks/netapp_api_disk | 6 +++---
web/plugins/wato/check_parameters.py | 4 ++--
4 files changed, 19 insertions(+), 5 deletions(-)
diff --git a/.werks/2159 b/.werks/2159
new file mode 100644
index 0000000..8bab418
--- /dev/null
+++ b/.werks/2159
@@ -0,0 +1,13 @@
+Title: netapp_api_disk.summary: Changed default thresholds to WARN on the first broken disk, CRIT on 50%
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1427284350
+
+The thresholds are configured using percentage levels on the broken to spare disk ratio.
+Previous versions of the check simply did not apply levels on the number of broken disks
+except you configured the ratio. We have added a default ratio of 1% for WARN and 50% for
+CRIT.
diff --git a/ChangeLog b/ChangeLog
index d3db00f..d661268 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -280,6 +280,7 @@
* 1896 FIX: ups_socomec_capacity: Now no longer critical when device reports -1 minutes left on battery...
* 1238 FIX: check_mk_agent.linux: Do not execute the multipath section if no /etc/multipath.conf exsist.
* 1240 FIX: multipath: improved detection for not installed multipath
+ * 2159 FIX: netapp_api_disk.summary: Changed default thresholds to WARN on the first broken disk, CRIT on 50%...
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checks/netapp_api_disk b/checks/netapp_api_disk
index 19b154a..a7001e5 100644
--- a/checks/netapp_api_disk
+++ b/checks/netapp_api_disk
@@ -113,8 +113,8 @@ def check_netapp_api_disk_summary(_no_item, params, info):
else:
yield 0, "%s: %s" % (text, len(disks))
- if params.get("broken_spare_ratio") and len(broken_disks):
- warn, crit = params["broken_spare_ratio"]
+ if broken_disks:
+ warn, crit = params.get("broken_spare_ratio", (1.0, 50.0))
ratio = float(len(broken_disks)) / (len(broken_disks) + spare_count) * 100
state = 0
if ratio >= crit:
@@ -122,7 +122,7 @@ def check_netapp_api_disk_summary(_no_item, params, info):
elif ratio >= warn:
state = 1
if state:
- yield state, "Too much broken disks (levels at %.1f%%/%.1f%%)" % (warn, crit)
+ yield state, "Too many broken disks (levels at %.1f%%/%.1f%%)" % (warn, crit)
check_info["netapp_api_disk.summary"] = {
'check_function' : check_netapp_api_disk_summary,
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 1da968f..1c3afa8 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -5592,8 +5592,8 @@ register_check_parameters(
Tuple(
title = _("Broken to spare ratio"),
elements = [
- Percentage(title = _("Warning at or above")),
- Percentage(title = _("Critical at or above")),
+ Percentage(title = _("Warning at or above"), default_value = 1.0),
+ Percentage(title = _("Critical at or above"), default_value = 50.0),
]
)),
],
Module: check_mk
Branch: master
Commit: 5c19d2457a2d90d48ae497afebe07729d0518dfa
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5c19d2457a2d90…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 24 14:34:57 2015 +0100
#2158 FIX Condition column in WATO rule tables has now a flexible width
In previous versions this column had a fixed width, which could lead
to strange layout problems where this column is filled up and others
would have space for being shrunk to give the condition column more
space.
---
.werks/2158 | 13 +++++++++++++
ChangeLog | 1 +
web/htdocs/wato.css | 4 ----
3 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/.werks/2158 b/.werks/2158
new file mode 100644
index 0000000..369a245
--- /dev/null
+++ b/.werks/2158
@@ -0,0 +1,13 @@
+Title: Condition column in WATO rule tables has now a flexible width
+Level: 1
+Component: wato
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1427204010
+
+In previous versions this column had a fixed width, which could lead
+to strange layout problems where this column is filled up and others
+would have space for being shrunk to give the condition column more
+space.
diff --git a/ChangeLog b/ChangeLog
index ca85263..d3db00f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -384,6 +384,7 @@
* 2045 FIX: Avoid fetching SNMP data when showing service list in WATO - unless Full Scan is pressed
* 2047 FIX: Allow overriding existing WATO rules by own files in local/ hierarchy...
* 2146 FIX: In distributed environments user notification rules trigger a profile synchronisation now...
+ * 2158 FIX: Condition column in WATO rule tables has now a flexible width...
Notifications:
* 1662 notification plugin spectrum: finalized script. now able to handle host notications
diff --git a/web/htdocs/wato.css b/web/htdocs/wato.css
index 83ee1ea..60f4c5a 100644
--- a/web/htdocs/wato.css
+++ b/web/htdocs/wato.css
@@ -609,10 +609,6 @@ table.validationerror img {
text-shadow: 0px 1px 0px #fff;
}
-.wato table.data.ruleset td.condition {
- width: 360px;
-}
-
/* Special styling for Timeperiods editor */
.wato table.timeperiod td.name {
width: 195px;
group-to-contactgroup sync with OpenLDAP (using posixGroup)
Message-ID: <55116378.KdV7x+3Jp+0JvLvL%lm(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: e0e8a3b11565a6fd3c196d4489df1b3b74c071f6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e0e8a3b11565a6…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Tue Mar 24 14:10:56 2015 +0100
#2157 FIX LDAP: Fixed group-to-role/group-to-contactgroup sync with OpenLDAP (using posixGroup)
---
.werks/2157 | 9 +++++++++
ChangeLog | 1 +
web/plugins/userdb/ldap.py | 12 ++++++++++--
3 files changed, 20 insertions(+), 2 deletions(-)
diff --git a/.werks/2157 b/.werks/2157
new file mode 100644
index 0000000..b73d703
--- /dev/null
+++ b/.werks/2157
@@ -0,0 +1,9 @@
+Title: LDAP: Fixed group-to-role/group-to-contactgroup sync with OpenLDAP (using posixGroup)
+Level: 1
+Component: multisite
+Compatible: compat
+Version: 1.2.7i1
+Date: 1427202535
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 2b2592d..ca85263 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -337,6 +337,7 @@
* 2149 FIX: LDAP: The diagnostic log has been changed to use a fixed path...
* 2150 FIX: Reworked internal logging mechanism...
* 1953 FIX: Fixed processing of html processing in input fields...
+ * 2157 FIX: LDAP: Fixed group-to-role/group-to-contactgroup sync with OpenLDAP (using posixGroup)
WATO:
* 1760 Added search form to manual checks page
diff --git a/web/plugins/userdb/ldap.py b/web/plugins/userdb/ldap.py
index 9e074f6..e0c0ae0 100644
--- a/web/plugins/userdb/ldap.py
+++ b/web/plugins/userdb/ldap.py
@@ -868,6 +868,9 @@ def register_user_attribute_sync_plugins():
}
def ldap_convert_groups_to_contactgroups(plugin, params, user_id, ldap_user, user):
+ # 0. Figure out how to check group membership.
+ user_cmp_val = ldap_member_attr().lower() == 'memberuid' and user_id or ldap_user['dn']
+
# 1. Fetch all existing group names in WATO
cg_names = load_group_information().get("contact", {}).keys()
@@ -876,7 +879,7 @@ def ldap_convert_groups_to_contactgroups(plugin, params, user_id, ldap_user, use
ldap_groups = ldap_group_members(cg_names, nested = params.get('nested', False))
# 3. Only add groups which the user is member of
- return {'contactgroups': [ g['cn'] for dn, g in ldap_groups.items() if ldap_user['dn'] in g['members']]}
+ return {'contactgroups': [ g['cn'] for dn, g in ldap_groups.items() if user_cmp_val in g['members']]}
ldap_attribute_plugins['groups_to_contactgroups'] = {
'title': _('Contactgroup Membership'),
@@ -904,6 +907,11 @@ def ldap_convert_groups_to_roles(plugin, params, user_id, ldap_user, user):
ldap_groups = dict(ldap_group_members([ dn.lower() for role_id, dn in params.items() if isinstance(dn, str) ],
filt_attr = 'distinguishedname', nested = params.get('nested', False)))
+ # posixGroup objects use the memberUid attribute to specify the group
+ # memberships. This is the username instead of the users DN. So the
+ # username needs to be used for filtering here.
+ user_cmp_val = ldap_member_attr().lower() == 'memberuid' and user_id or ldap_user['dn']
+
roles = set([])
# Loop all roles mentioned in params (configured to be synchronized)
@@ -913,7 +921,7 @@ def ldap_convert_groups_to_roles(plugin, params, user_id, ldap_user, user):
dn = dn.lower() # lower case matching for DNs!
# if group could be found and user is a member, add the role
- if dn in ldap_groups and ldap_user['dn'] in ldap_groups[dn]['members']:
+ if dn in ldap_groups and user_cmp_val in ldap_groups[dn]['members']:
roles.add(role_id)
# Load default roles from default user profile when the user got no role