Module: check_mk
Branch: master
Commit: c17461dd7dd5d13c80b97b5cd858fa9c19dda0ee
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c17461dd7dd5d1…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Mon Mar 7 14:44:59 2016 +0100
3266 FIX check_smtp: when set to IPv6 it used the IPv4 address nevertheless
---
.werks/3266 | 10 ++++++++++
ChangeLog | 1 +
checks/check_smtp | 5 ++++-
web/plugins/wato/active_checks.py | 16 ++++------------
4 files changed, 19 insertions(+), 13 deletions(-)
diff --git a/.werks/3266 b/.werks/3266
new file mode 100644
index 0000000..8cd1a90
--- /dev/null
+++ b/.werks/3266
@@ -0,0 +1,10 @@
+Title: check_smtp: when set to IPv6 it used the IPv4 address nevertheless
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.9i1
+Date: 1457358264
+
+
diff --git a/ChangeLog b/ChangeLog
index ed12996..983fd69 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -58,6 +58,7 @@
* 3256 FIX: blade_bx_powerfan: fixed wrong levels handling and minor cleanup
* 3258 FIX: dell_idrac_disks: fixed disk and component status handling
* 3087 FIX: fixed very rare crash in active checks...
+ * 3266 FIX: check_smtp: when set to IPv6 it used the IPv4 address nevertheless
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/check_smtp b/checks/check_smtp
index b38cf83..d03a3af 100644
--- a/checks/check_smtp
+++ b/checks/check_smtp
@@ -35,11 +35,14 @@ def check_smtp_arguments(params):
port = int(settings["port"]) # ValueSpec was broken, convert to int
args += ' -p %d' % port
+ host_address = '$HOSTADDRESS$'
if "ip_version" in settings:
if settings['ip_version'] == 'ipv4':
args += ' -4'
+ host_address = '$HOST_ADDRESS_4$'
else:
args += ' -6'
+ host_address = '$HOST_ADDRESS_6$'
for s in settings.get("commands", []):
args += ' -C %s' % quote_shell_string(s)
@@ -74,7 +77,7 @@ def check_smtp_arguments(params):
if 'hostname' in settings:
args += ' -H %s' % settings['hostname']
else:
- args += ' -H $HOSTADDRESS$'
+ args += ' -H ' + host_address
return args
def check_smtp_desc(params):
diff --git a/web/plugins/wato/active_checks.py b/web/plugins/wato/active_checks.py
index b5d3638..f030ed7 100644
--- a/web/plugins/wato/active_checks.py
+++ b/web/plugins/wato/active_checks.py
@@ -1186,19 +1186,11 @@ register_rule(group,
)
),
( "ip_version",
- Alternative(
+ DropdownChoice(
title = _("IP-Version"),
- elements = [
- FixedValue(
- "ipv4",
- totext = "",
- title = _("IPv4")
- ),
- FixedValue(
- "ipv6",
- totext = "",
- title = _("IPv6")
- ),
+ choices = [
+ ( "ipv4", _("IPv4") ),
+ ( "ipv6", _("IPv6") ),
],
),
),