Module: check_mk
Branch: master
Commit: abe0b803fa2b3548dae75a36d32b1d5c09355ba9
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=abe0b803fa2b35…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Aug 21 15:24:17 2011 +0200
Multisite: new command for clearing modified attributes
---
.bugs/32 | 10 +++++++---
ChangeLog | 1 +
web/htdocs/views.py | 44 +++++++++++++++++++++++++++++---------------
3 files changed, 37 insertions(+), 18 deletions(-)
diff --git a/.bugs/32 b/.bugs/32
index 1507919..33b1c32 100644
--- a/.bugs/32
+++ b/.bugs/32
@@ -1,13 +1,17 @@
Title: modified_attributes bei Bedarf zurücksetzen
Component: multisite
+State: done
+Class: nastiness
+Date: 2010-12-21 20:48:09
Benefit: 1
-State: open
Cost: 3
-Date: 2010-12-21 20:48:09
-Class: nastiness
+Fun: 0
Wenn man z.B. die active checks aus und wieder eingeschaltet hat,
dann erscheint der grüne Haken. Irgendwie müsste man die modified
Attributes zurücksetzen können. Evtl. hilft auch die Doku, dass
man das über die state retention konfiguriert. Das Kommando
zum Zurücksetzen heisst
CHANGE_SVC_MODATTR;<host_name>;<service_description>;<value>
+
+2011-08-21 15:23:59: changed state open -> done
+Umgesetzt. Es gibt jetzt ein eigenes Kommando dafür.
diff --git a/ChangeLog b/ChangeLog
index cc7bdb0..5f1aecd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -37,6 +37,7 @@
* Bookmarks snapin: save relative URLs whenever possible
* Man-Pages of Check_MK checks shown in Multisite honor OMD's local hierarchy
* nicer output of substates, translate (!) and (!!) into HTML code
+ * new command for clearing modified attributes (red cross, green checkmark)
WATO:
* Show error message in case of empty inventory due to agent error
diff --git a/web/htdocs/views.py b/web/htdocs/views.py
index 164e657..4f11b50 100644
--- a/web/htdocs/views.py
+++ b/web/htdocs/views.py
@@ -57,34 +57,38 @@ def load_plugins():
return
loaded_with_language = current_language
- config.declare_permission_section("action", "Commands on
Objects")
+ config.declare_permission_section("action", _("Commands on
Objects"))
config.declare_permission("action.notifications",
- "Enable/disable notifications",
- "Enable and disable notifications on hosts and services",
+ _("Enable/disable notifications"),
+ _("Enable and disable notifications on hosts and services"),
[ "admin" ])
config.declare_permission("action.enablechecks",
- "Enable/disable checks",
- "Enable and disable active or passive checks on hosts and
services",
+ _("Enable/disable checks"),
+ _("Enable and disable active or passive checks on hosts and
services"),
+ [ "admin" ])
+ config.declare_permission("action.clearmodattr",
+ _("Clear modified attributes"),
+ _("Remove the information that an attribute (like check enabling) has
been changed"),
[ "admin" ])
config.declare_permission("action.reschedule",
- "Reschedule checks",
- "Reschedule host and service checks",
+ _("Reschedule checks"),
+ _("Reschedule host and service checks"),
[ "user", "admin" ])
config.declare_permission("action.fakechecks",
- "Fake check results",
- "Manually submit check results for host and service checks",
+ _("Fake check results"),
+ _("Manually submit check results for host and service checks"),
[ "admin" ])
config.declare_permission("action.acknowledge",
- "Acknowledge",
- "Acknowledge host and service problems and remove
acknowledgements",
+ _("Acknowledge"),
+ _("Acknowledge host and service problems and remove
acknowledgements"),
[ "user", "admin" ])
config.declare_permission("action.addcomment",
- "Add comments",
- "Add comments to hosts or services, and remove comments",
+ _("Add comments"),
+ _("Add comments to hosts or services, and remove comments"),
[ "user", "admin" ])
config.declare_permission("action.downtimes",
- "Set/Remove Downtimes",
- "Schedule and remove downtimes on hosts and services",
+ _("Set/Remove Downtimes"),
+ _("Schedule and remove downtimes on hosts and services"),
[ "user", "admin" ])
load_web_plugins("views", globals())
@@ -1781,6 +1785,12 @@ def show_host_service_actions(what):
"<input type=submit name=_disable_passive_checks
value=\"Disable\"> "
"</td></tr>\n")
+ if config.may("action.clearmodattr"):
+ html.write("<tr><td class=legend>Modified
attributes</td>\n"
+ "<td class=content>\n"
+ "<input type=submit name=_clear_modattr value=\"Clear
information about modified attributes\">"
+ "</td></tr>\n")
+
if config.may("action.fakechecks"):
if what == "service":
states = ["Ok", "Warning", "Critical",
"Unknown"]
@@ -1911,6 +1921,10 @@ def nagios_host_service_action_command(what, dataset):
command = "DISABLE_PASSIVE_" + cmdtag + "_CHECKS;%s" % spec
title = "<b>disable passive checks</b> of"
+ elif html.var("_clear_modattr") and
config.may("action.clearmodattr"):
+ command = "CHANGE_" + cmdtag + "_MODATTR;%s;0" % spec
+ title = "<b>clear the information about modified attributes</b>
of"
+
elif html.var("_resched_checks") and
config.may("action.reschedule"):
command = "SCHEDULE_FORCED_" + cmdtag + "_CHECK;%s;%d" %
(spec, int(time.time()))
title = "<b>reschedule an immediate check</b> of"