Module: check_mk
Branch: master
Commit: b5fb884d4670e612cc44b83480b38ea2c7c2f6cb
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b5fb884d4670e6…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Nov 17 14:31:16 2015 +0100
#1302 Added new WATO permission to deactivate the function rename of hosts
Whit this new role permission it's no possible to control who can or not can rename hosts.
---
.werks/1302 | 10 ++++++++++
ChangeLog | 1 +
web/htdocs/wato.py | 18 ++++++++++++++++--
3 files changed, 27 insertions(+), 2 deletions(-)
diff --git a/.werks/1302 b/.werks/1302
new file mode 100644
index 0000000..a782629
--- /dev/null
+++ b/.werks/1302
@@ -0,0 +1,10 @@
+Title: Added new WATO permission to deactivate the function rename of hosts
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447767011
+Class: feature
+
+Whit this new role permission it's no possible to control who can or not can rename hosts.
+
diff --git a/ChangeLog b/ChangeLog
index d9530f7..6aeab0e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -107,6 +107,7 @@
WATO:
* 2442 WATO remove host: improved cleanup of obsolete host files...
* 2785 WATO Web-API: i18n of error messages and intitial validation of incoming request...
+ * 1302 Added new WATO permission to deactivate the function rename of hosts...
* 2666 FIX: Fix search for global configuration variables: ignore case now
* 2715 FIX: Fixed visibility of BI aggregations in editor
* 2716 FIX: Fixed error reporting on disabled checks page in case of broken man pages
diff --git a/web/htdocs/wato.py b/web/htdocs/wato.py
index 54d336c..07a6af8 100644
--- a/web/htdocs/wato.py
+++ b/web/htdocs/wato.py
@@ -875,7 +875,8 @@ def mode_folder(phase):
if config.may("wato.services"):
html.context_button(_("Bulk Discovery"), make_link([("mode", "bulkinventory"), ("all", "1")]),
"inventory")
- html.context_button(_("Bulk Renaming"), make_link([("mode", "bulk_rename_host")]), "rename_host")
+ if config.may("wato.rename_hosts"):
+ html.context_button(_("Bulk Renaming"), make_link([("mode", "bulk_rename_host")]), "rename_host")
if not g_folder.get(".lock_hosts") and config.may("wato.parentscan") and auth_write:
html.context_button(_("Parent scan"), make_link([("mode", "parentscan"), ("all", "1")]),
"parentscan")
@@ -2063,7 +2064,7 @@ def mode_edithost(phase, new, cluster):
if config.may('wato.rulesets'):
html.context_button(_("Parameters"),
make_link([("mode", "object_parameters"), ("host", hostname)]), "rulesets")
- if not g_folder.get(".lock_hosts"):
+ if config.may("wato.rename_hosts") and not g_folder.get(".lock_hosts"):
html.context_button(_("Rename %s") % (cluster and _("Cluster") or _("Host")),
make_link([("mode", "rename_host"), ("host", hostname)]), "rename_host")
if not cluster:
@@ -2280,6 +2281,10 @@ def check_edit_host_permissions(folder, host, hostname):
# '----------------------------------------------------------------------'
def mode_bulk_rename_host(phase):
+
+ if not config.may("wato.rename_hosts"):
+ raise MKGeneralException(_("You don't have the right to rename hosts"))
+
if phase == "title":
return _("Bulk renaming of hosts")
@@ -2513,6 +2518,9 @@ def mode_rename_host(phase):
if hostname not in g_folder[".hosts"]:
raise MKGeneralException(_("You called this page with an invalid host name."))
+ if not config.may("wato.rename_hosts"):
+ raise MKGeneralException(_("You don't have the right to rename hosts"))
+
check_host_permissions(hostname)
host = g_folder[".hosts"][hostname]
@@ -20500,6 +20508,12 @@ def load_plugins():
"<i>Modify existing hosts</i>."),
[ "admin", "user" ])
+ config.declare_permission("wato.rename_hosts",
+ _("Rename existing hosts"),
+ _("Rename existing hosts. Please also add the permission "
+ "<i>Modify existing hosts</i>."),
+ [ "admin" ])
+
config.declare_permission("wato.manage_hosts",
_("Add & remove hosts"),
_("Add hosts to the monitoring and remove hosts "
Module: check_mk
Branch: master
Commit: cdc6abeea8f88a9acadca8baa15c9a238c563117
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=cdc6abeea8f88a…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Nov 17 13:58:52 2015 +0100
#2794 FIX The encoding parameter set in the agent sections was not working
You can configure the encoding of agent sections with the additional section parameter
<i>encoding(cp437)</i>, e.g. "<<<mycheck:sep(9):encoding(cp437)>>>.
This feature was broken, due to some code restructuring a few months ago.
---
.werks/2794 | 11 +++++++++++
ChangeLog | 3 ++-
modules/check_mk_base.py | 2 +-
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/2794 b/.werks/2794
new file mode 100644
index 0000000..63ff5a6
--- /dev/null
+++ b/.werks/2794
@@ -0,0 +1,11 @@
+Title: The encoding parameter set in the agent sections was not working
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447764921
+Class: fix
+
+You can configure the encoding of agent sections with the additional section parameter
+<i>encoding(cp437)</i>, e.g. "<<<mycheck:sep(9):encoding(cp437)>>>.
+This feature was broken, due to some code restructuring a few months ago.
diff --git a/ChangeLog b/ChangeLog
index 9e6912a..dcec0cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -83,6 +83,7 @@
* 2836 FIX: pandacom_psu: fixed handling of not available power supplies
* 2766 FIX: juniper_fru: Don't discover devices reported as "empty"...
* 2790 FIX: check_dns: now able to configure milliseconds as expected response time...
+ * 2794 FIX: The encoding parameter set in the agent sections was not working...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
@@ -120,7 +121,7 @@
* 2760 FIX: Fixed case where "activate changes" was not commiting the pending changes entries correctly...
* 2767 FIX: Fixed broken user list when non unicode mail addresses are loaded
* 2791 FIX: Service parameter overview: Fixed problem displaying incorrect rule for classical checks...
- * 2793 FIX: Prevent python unicode warnings for services with umlauts...
+ * 2793 FIX: Parameter Overview: Prevent python unicode warnings for services with umlauts...
Notifications:
* 2728 FIX: Removed debug notification script (was not executable)...
diff --git a/modules/check_mk_base.py b/modules/check_mk_base.py
index 3951089..1a5286e 100644
--- a/modules/check_mk_base.py
+++ b/modules/check_mk_base.py
@@ -944,7 +944,7 @@ def parse_info(lines, hostname):
def decode_incoming_string(s, encoding="utf-8"):
try:
- return s.decode('utf-8')
+ return s.decode(encoding)
except:
return s.decode(fallback_agent_output_encoding)
Module: check_mk
Branch: master
Commit: 86568aaf90e8565ab09a74262f4ebdf214a38d9e
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=86568aaf90e856…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Tue Nov 17 10:47:33 2015 +0100
#2793 FIX Prevent python unicode warnings for services with umlauts
The parameter overview page for a service failed when there were umlauts
in the service description. This bug was introduced a few months ago during
some internal code restructuring concerning unicode strings.
---
.werks/2793 | 11 +++++++++++
ChangeLog | 1 +
modules/automation.py | 2 +-
modules/check_mk.py | 3 +++
4 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/2793 b/.werks/2793
new file mode 100644
index 0000000..64ecdec
--- /dev/null
+++ b/.werks/2793
@@ -0,0 +1,11 @@
+Title: Parameter Overview: Prevent python unicode warnings for services with umlauts
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447753328
+Class: fix
+
+The parameter overview page for a service failed when there were umlauts
+in the service description. This bug was introduced a few months ago during
+some internal code restructuring concerning unicode strings.
diff --git a/ChangeLog b/ChangeLog
index f50e247..9e6912a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -120,6 +120,7 @@
* 2760 FIX: Fixed case where "activate changes" was not commiting the pending changes entries correctly...
* 2767 FIX: Fixed broken user list when non unicode mail addresses are loaded
* 2791 FIX: Service parameter overview: Fixed problem displaying incorrect rule for classical checks...
+ * 2793 FIX: Prevent python unicode warnings for services with umlauts...
Notifications:
* 2728 FIX: Removed debug notification script (was not executable)...
diff --git a/modules/automation.py b/modules/automation.py
index f303302..578fd4a 100644
--- a/modules/automation.py
+++ b/modules/automation.py
@@ -240,7 +240,7 @@ def schedule_inventory_check(hostname):
def automation_analyse_service(args):
global g_hostname
hostname = args[0]
- servicedesc = args[1]
+ servicedesc = args[1].decode("utf-8")
g_hostname = hostname # To be sure for all subfunctions
# We just consider types of checks that are managed via WATO.
diff --git a/modules/check_mk.py b/modules/check_mk.py
index f654be4..9d3639b 100755
--- a/modules/check_mk.py
+++ b/modules/check_mk.py
@@ -2249,6 +2249,9 @@ def service_description(check_type, item):
else:
descr_format = check_info[check_type]["service_description"]
+ if type(descr_format) == str:
+ descr_format = descr_format.decode("utf-8")
+
# Note: we strip the service description (remove spaces).
# One check defines "Pages %s" as a description, but the item
# can by empty in some cases. Nagios silently drops leading