Module: check_mk
Branch: master
Commit: 2a40a1db0950a55f5471e1b39d632faaa73ba10e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=2a40a1db0950a5…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 4 19:45:23 2013 +0100
Updated bug entries #0906
---
.bugs/906 | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/906 b/.bugs/906
index 7e3b977..dc2c2a1 100644
--- a/.bugs/906
+++ b/.bugs/906
@@ -1,9 +1,9 @@
Title: logwatch.ec: Need some fallback mechanism if processing takes too long
Component: checks
-State: open
+Class: bug
+State: done
Date: 2013-01-31 11:23:38
Targetversion: 1.2.2
-Class: bug
Nagios kills Check_MK when it takes too long. When e.g. logwatch.ec is taking
more than 60 seconds, the script is terminated and all unprocessed messages
@@ -25,3 +25,6 @@ logwatch.ec: Add a third message processing mode, which writes a file into
this spool directory named ".<hostname>_<item>_timestamp". Escape the "/"
with "\" in the file name. After writing rename the file to the same name
without the leading dot.
+
+2013-03-04 19:45:21: changed state open -> done
+Has been implemented.
Module: check_mk
Branch: master
Commit: 90b4386fd582fc3f98e1d95bcebc01dce15f34c6
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=90b4386fd582fc…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 4 12:24:56 2013 +0100
Updated bug entries #0789
---
.bugs/789 | 5 +----
1 files changed, 1 insertions(+), 4 deletions(-)
diff --git a/.bugs/789 b/.bugs/789
index c330767..c6b0813 100644
--- a/.bugs/789
+++ b/.bugs/789
@@ -1,7 +1,7 @@
Title: Settings in multisite.mk without default values persist in browser cache
Component: multisite
Class: bug
-State: wontfix
+State: open
Date: 2012-09-13 17:42:33
Targetversion: 1.2.3
@@ -11,6 +11,3 @@ must not modify files of the main distribution). If it once sets a value in
multisite.mk and that is later removed (factory settings) then the positive
settings survives in the browser cache. We need to find a method how extension
modules can define or declare default values for settings in multisite.mk
-
-2013-03-04 12:24:04: changed state open -> wontfix
-Wont fix this in 1.2.2.
Module: check_mk
Branch: master
Commit: f0c333a1ff2d0410d5b5ec13ec2026aacbb57cab
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f0c333a1ff2d04…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 4 12:24:11 2013 +0100
Updated bug entries #0789
---
.bugs/789 | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/.bugs/789 b/.bugs/789
index 46d43fe..c330767 100644
--- a/.bugs/789
+++ b/.bugs/789
@@ -1,9 +1,9 @@
Title: Settings in multisite.mk without default values persist in browser cache
Component: multisite
-State: open
+Class: bug
+State: wontfix
Date: 2012-09-13 17:42:33
Targetversion: 1.2.3
-Class: bug
If you write an extension (like mkeventd) that wants to put a settings
into multisite.mk then it cannot put a default value into config.py (it
@@ -11,3 +11,6 @@ must not modify files of the main distribution). If it once sets a value in
multisite.mk and that is later removed (factory settings) then the positive
settings survives in the browser cache. We need to find a method how extension
modules can define or declare default values for settings in multisite.mk
+
+2013-03-04 12:24:04: changed state open -> wontfix
+Wont fix this in 1.2.2.
Module: check_mk
Branch: master
Commit: ae5150b35be9d230e17aa6e6282e90157c1e4799
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ae5150b35be9d2…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 4 11:16:27 2013 +0100
FIX: BI see_all permission is now working again
---
.bugs/825 | 7 +++++--
.bugs/826 | 7 +++++--
ChangeLog | 1 +
web/htdocs/bi.py | 5 ++++-
4 files changed, 15 insertions(+), 5 deletions(-)
diff --git a/.bugs/825 b/.bugs/825
index c4339ac..868ddd2 100644
--- a/.bugs/825
+++ b/.bugs/825
@@ -1,8 +1,11 @@
Title: BI: See all Nagios objects seems not to work
Component: bi
-State: open
+Class: bug
+State: done
Date: 2013-01-24 17:44:29
Targetversion: 1.2.2
-Class: bug
See Ticket 793881
+
+2013-03-04 11:15:48: changed state open -> done
+Just fixed it.
diff --git a/.bugs/826 b/.bugs/826
index cb7d6de..a862a58 100644
--- a/.bugs/826
+++ b/.bugs/826
@@ -1,10 +1,13 @@
Title: function paint_aggr_tree_foldable is not defiened
Component: bi
-State: open
+Class: bug
+State: done
Date: 2013-02-01 11:33:32
Targetversion: 1.2.2
-Class: bug
View painter paint_aggr_tree_foldable is used:
web/plugins/views/bi.py: "paint" : lambda row: paint_aggr_tree_foldable(row, boxes = True, omit_root = True),
but nowhere defined
+
+2013-03-04 10:57:06: changed state open -> done
+already solved. This code does not exist anymore.
diff --git a/ChangeLog b/ChangeLog
index 5dffbad..074d8e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -98,6 +98,7 @@
* FIX: list of BI aggregates was incomplete in some cases
* FIX: single host aggregations didn't work for aggregations += [...]
* FIX: top-down and bottom-up was broken in case of "only problems"
+ * FIX: BI see_all permission is now working again
* Do not handle PENDING as "problem" anymore
* Make titles of non-leaf tree nodes klickable
diff --git a/web/htdocs/bi.py b/web/htdocs/bi.py
index a52b082..2439f1b 100644
--- a/web/htdocs/bi.py
+++ b/web/htdocs/bi.py
@@ -1111,10 +1111,12 @@ def get_status_info(required_hosts):
filter += "Filter: name = %s\n" % host
if len(hosts) > 1:
filter += "Or: %d\n" % len(hosts)
+ html.live.set_auth_domain('bi')
data = html.live.query(
"GET hosts\n"
"Columns: name state plugin_output services_with_info\n"
+ filter)
+ html.live.set_auth_domain('read')
tuples += [((site, e[0]), e[1:]) for e in data]
return dict(tuples)
@@ -1138,14 +1140,15 @@ def get_status_info_filtered(filter_header, only_sites, limit, add_columns, fetc
html.write('<div class="livestatus message" onmouseover="this.style.display=\'none\';">'
'<tt>%s</tt></div>\n' % (query.replace('\n', '<br>\n')))
-
html.live.set_only_sites(only_sites)
html.live.set_prepend_site(True)
+ html.live.set_auth_domain('bi')
data = html.live.query(query)
html.live.set_prepend_site(False)
html.live.set_only_sites(None)
+ html.live.set_auth_domain('read')
headers = [ "site" ] + columns
hostnames = [ row[1] for row in data ]
Module: check_mk
Branch: master
Commit: 114b818e4b0854affe822583533c00accb0b858d
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=114b818e4b0854…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Mon Mar 4 12:11:07 2013 +0100
FIX: added checks wether or not a contactgroup can be deleted
---
.bugs/916 | 7 +++-
ChangeLog | 1 +
web/htdocs/wato.py | 76 +++++++++++++++++++++++++++++++++++++++++-----------
3 files changed, 66 insertions(+), 18 deletions(-)
diff --git a/.bugs/916 b/.bugs/916
index 7385abb..0985c70 100644
--- a/.bugs/916
+++ b/.bugs/916
@@ -1,9 +1,9 @@
Title: Contactgroup deletion does not affect rules / Rules break on next save
Component: wato
-State: open
+Class: bug
+State: done
Date: 2013-02-07 11:10:41
Targetversion: 1.2.2
-Class: bug
When having a contactgroup and a rule which assignes the group,
then deleting the group, the rule still points to the group.
@@ -12,3 +12,6 @@ When opening the edit dialog for that rule, the configured
value can not be selected anymore, since the value does not
exist in the dropdown field. The first element is selected
. When saving this rule it changes the value! this is bad.
+
+2013-03-04 12:06:07: changed state open -> done
+Added checks to find all places where this contactgroup could be referenced
diff --git a/ChangeLog b/ChangeLog
index 074d8e2..9a3fd1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,7 @@
* FIX: stop doing snapin refreshes after they have been removed
* FIX: sidebar snapins which refresh do not register for restart detection anymore
* FIX: fix user database corruption in case of a race condition
+ * FIX: added checks wether or not a contactgroup can be deleted
* Changed sidebar snapin reload to a global interval (option:
sidebar_update_interval), defaults to 30 seconds
* Sidebar snapins are now bulk updated with one HTTP request each interval
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 4e6c116..9ff16fa 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -5647,6 +5647,57 @@ def save_configuration_vars(vars, filename):
# | Mode for editing host-, service- and contact groups |
# '----------------------------------------------------------------------'
+# Check if a group is currently in use and cannot be deleted
+# Returns a list of occurrances.
+# Possible usages:
+# - 1. rules: host to contactgroups, services to contactgroups
+# - 2. user memberships
+def find_usage_of_contact_groups(name):
+ # Part 1: Rules
+ used_in = []
+ rulesets = load_all_rulesets()
+ for varname in [ 'host_contactgroups', 'service_contactgroups' ]:
+ ruleset = rulesets[varname]
+ rulespec = g_rulespecs[varname]
+ for folder, rule in ruleset:
+ value, tag_specs, host_list, item_list, rule_options = parse_rule(rulespec, rule)
+ if value == name:
+ used_in.append(("%s: %s" % (_("Ruleset"), g_rulespecs[varname]["title"]),
+ make_link([("mode", "edit_ruleset"), ("varname", varname)])))
+
+ # Is the contactgroup assigned to a user?
+ users = filter_hidden_users(userdb.load_users())
+ entries = users.items()
+ entries.sort(cmp = lambda a, b: cmp(a[1].get("alias"), b[1].get("alias")))
+ for userid, user in entries:
+ cgs = user.get("contactgroups", [])
+ if name in cgs:
+ used_in.append(('%s: %s' % (_('User'), user.get('alias')),
+ make_link([('mode', 'edit_user'), ('edit', userid)])))
+
+ global_config = load_configuration_settings()
+
+ # Used in default_user_profile?
+ domain, valuespec, need_restart, allow_reset = g_configvars['default_user_profile']
+ configured = global_config.get('default_user_profile', {})
+ default_value = valuespec.default_value()
+ if (configured and name in configured['contactgroups']) \
+ or name in default_value['contactgroups']:
+ used_in.append(('%s' % (_('Default User Profile')),
+ make_link([('mode', 'edit_configvar'), ('varname', 'default_user_profile')])))
+
+ # Is the contactgroup used in mkeventd notify (if available)?
+ if 'mkeventd_notify_contactgroup' in g_configvars:
+ domain, valuespec, need_restart, allow_reset = g_configvars['mkeventd_notify_contactgroup']
+ configured = global_config.get('mkeventd_notify_contactgroup')
+ default_value = valuespec.default_value()
+ if (configured and name == configured) \
+ or name == default_value:
+ used_in.append(('%s' % (valuespec.title()),
+ make_link([('mode', 'edit_configvar'), ('varname', 'mkeventd_notify_contactgroup')])))
+
+ return used_in
+
def mode_groups(phase, what):
if what == "host":
what_name = _("host groups")
@@ -5676,22 +5727,15 @@ def mode_groups(phase, what):
delname = html.var("_delete")
if what == 'contact':
- # Is the contactgroup in use?
- member_links = []
- users = filter_hidden_users(userdb.load_users())
- entries = users.items()
- entries.sort(cmp = lambda a, b: cmp(a[1].get("alias"), b[1].get("alias")))
- for id, user in entries:
- cgs = user.get("contactgroups", [])
- if delname in cgs:
- member_links.append('<a href="%s">%s</a>' %
- (make_link([('mode', 'edit_user'), ('edit', id)]), user.get('alias')))
-
- if member_links:
- raise MKUserError(None,
- _('Unable to delete the group %s. It still has the following members: %s. '
- ' You must first remove all members from the group to be able to delete the group.') %
- (delname, ', '.join(member_links)))
+ usages = find_usage_of_contact_groups(delname)
+ if usages:
+ message = "<b>%s</b><br>%s:<ul>" % \
+ (_("You cannot delete this contactgroup."),
+ _("It is still in use by"))
+ for title, link in usages:
+ message += '<li><a href="%s">%s</a></li>\n' % (link, title)
+ message += "</ul>"
+ raise MKUserError(None, message)
confirm_txt = _('Do you really want to delete the %s group %s?') % (what, delname)
else: