Module: check_mk
Branch: master
Commit: a4746e22b06fffc8842be93a4f7e93fe6fdfde63
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a4746e22b06fff…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Aug 4 09:40:12 2016 +0200
3755 FIX Preventing to insert non ASCII characters in host addresses now
---
.bugs/2465 | 7 ++-
.werks/3755 | 9 ++++
ChangeLog | 1 +
web/plugins/wato/builtin_attributes.py | 80 +++++++++++++++++---------------
4 files changed, 58 insertions(+), 39 deletions(-)
diff --git a/.bugs/2465 b/.bugs/2465
index 3a2de88..045cd05 100644
--- a/.bugs/2465
+++ b/.bugs/2465
@@ -1,9 +1,9 @@
Title: ipaddress and ipv6address attributes allow non ASCII characters
Component: wato
-State: open
+Class: bug
+State: done
Date: 2016-08-03 17:09:06
Targetversion: 1.2.8
-Class: bug
It's configured with the TextAttribute() object. Shouldn't we make it only accept
ASCII characters
just like the TextASCII() valuespec? Or change these attributes to ValueSpecAttribute()
and really
@@ -12,3 +12,6 @@ use TextAscii()?
We should not allow non ascii characters in these fields.
But there are umlaut domains. So: what do to?
+
+2016-08-04 09:37:35: changed state open -> done
+Fixed in master
diff --git a/.werks/3755 b/.werks/3755
new file mode 100644
index 0000000..217808c
--- /dev/null
+++ b/.werks/3755
@@ -0,0 +1,9 @@
+Title: Preventing to insert non ASCII characters in host addresses now
+Level: 1
+Component: wato
+Compatible: compat
+Version: 1.4.0i1
+Date: 1470296371
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 375ef30..7f8b44f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -524,6 +524,7 @@
* 3733 FIX: BI rule editor: Increased size of argument/parameter/id input fields
* 3735 FIX: Fixed wrong host search link in case of deleting site with hosts
assigned
* 3754 FIX: Cluster nodes are now correctly validated for invalid characters
+ * 3755 FIX: Preventing to insert non ASCII characters in host addresses now
Notifications:
* 3263 Notifications: allow users to restrict by their contact groups...
diff --git a/web/plugins/wato/builtin_attributes.py
b/web/plugins/wato/builtin_attributes.py
index 2beba20..fcc1c78 100644
--- a/web/plugins/wato/builtin_attributes.py
+++ b/web/plugins/wato/builtin_attributes.py
@@ -34,43 +34,49 @@ declare_host_attribute(NagiosTextAttribute("alias",
"alias", _("Alias"),
show_in_table = True,
show_in_folder = False)
-declare_host_attribute(TextAttribute("ipaddress", _("IPv4 Address"),
- _("In case the name of the host is not resolvable via
<tt>/etc/hosts</tt> "
- "or DNS by your monitoring server, you can specify an
explicit IP "
- "address or a resolvable DNS name of the host
here.<br> <b>Notes</b>:<br> "
- "1. If you leave this attribute empty, hostname resolution
will be done when "
- "you activate the configuration. "
- "Check_MKs builtin DNS cache is activated per default in
the global "
- "configuration to speed up the activation process. The
cache is normally "
- "updated daily with a cron job. You can manually update the
cache with the "
- "command <tt>cmk -v
--update-dns-cache</tt>.<br>"
- "2. If you enter a DNS name here, the DNS resolution will
be carried out "
- "each time the host is checked. Check_MKs DNS cache will
NOT be queried. "
- "Use this only for hosts with dynamic IP addresses."
- ),
- allow_empty = False),
- show_in_table = True,
- show_in_folder = False,
- depends_on_tags = ["ip-v4"])
-
-declare_host_attribute(TextAttribute("ipv6address", _("IPv6
Address"),
- _("In case the name of the host is not resolvable via
<tt>/etc/hosts</tt> "
- "or DNS by your monitoring server, you can specify an
explicit IPv6 "
- "address or a resolvable DNS name of the host
here.<br> <b>Notes</b>:<br> "
- "1. If you leave this attribute empty, hostname resolution
will be done when "
- "you activate the configuration. "
- "Check_MKs builtin DNS cache is activated per default in
the global "
- "configuration to speed up the activation process. The
cache is normally "
- "updated daily with a cron job. You can manually update the
cache with the "
- "command <tt>cmk -v
--update-dns-cache</tt>.<br>"
- "2. If you enter a DNS name here, the DNS resolution will
be carried out "
- "each time the host is checked. Check_MKs DNS cache will
NOT be queried. "
- "Use this only for hosts with dynamic IP addresses."
- ),
- allow_empty = False),
- show_in_table = True,
- show_in_folder = False,
- depends_on_tags = ["ip-v6"])
+declare_host_attribute(ValueSpecAttribute("ipaddress",
+ TextAscii(
+ title = _("IPv4 Address"),
+ help = _("In case the name of the host is not resolvable via
<tt>/etc/hosts</tt> "
+ "or DNS by your monitoring server, you can specify an explicit IP
"
+ "address or a resolvable DNS name of the host here.<br>
<b>Notes</b>:<br> "
+ "1. If you leave this attribute empty, hostname resolution will be
done when "
+ "you activate the configuration. "
+ "Check_MKs builtin DNS cache is activated per default in the global
"
+ "configuration to speed up the activation process. The cache is
normally "
+ "updated daily with a cron job. You can manually update the cache
with the "
+ "command <tt>cmk -v
--update-dns-cache</tt>.<br>"
+ "2. If you enter a DNS name here, the DNS resolution will be
carried out "
+ "each time the host is checked. Check_MKs DNS cache will NOT be
queried. "
+ "Use this only for hosts with dynamic IP addresses."),
+ allow_empty = False,
+ )),
+ show_in_table = True,
+ show_in_folder = False,
+ depends_on_tags = ["ip-v4"]
+)
+
+declare_host_attribute(ValueSpecAttribute("ipv6address",
+ TextAscii(
+ title = _("IPv6 Address"),
+ help = _("In case the name of the host is not resolvable via
<tt>/etc/hosts</tt> "
+ "or DNS by your monitoring server, you can specify an explicit IPv6
"
+ "address or a resolvable DNS name of the host here.<br>
<b>Notes</b>:<br> "
+ "1. If you leave this attribute empty, hostname resolution will be
done when "
+ "you activate the configuration. "
+ "Check_MKs builtin DNS cache is activated per default in the global
"
+ "configuration to speed up the activation process. The cache is
normally "
+ "updated daily with a cron job. You can manually update the cache
with the "
+ "command <tt>cmk -v
--update-dns-cache</tt>.<br>"
+ "2. If you enter a DNS name here, the DNS resolution will be
carried out "
+ "each time the host is checked. Check_MKs DNS cache will NOT be
queried. "
+ "Use this only for hosts with dynamic IP addresses."),
+ allow_empty = False,
+ )),
+ show_in_table = True,
+ show_in_folder = False,
+ depends_on_tags = ["ip-v6"]
+)
_snmpv3_auth_elements = [
DropdownChoice(