From af5771426bce71cac7d78048ea66f874cfb58f7e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lo=C3=AFc=20Yhuel?= Date: Fri, 21 Jun 2019 02:03:12 +0200 Subject: [PATCH] luci-app-statistics: add address family configuration for ping MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It allows to force ipv4 or ipv6 when the DNS returns both addresses, but only one works (for example if there is no ipv6 connectivity). Signed-off-by: Loïc Yhuel --- .../luasrc/model/cbi/luci_statistics/ping.lua | 8 ++++++++ .../luci-app-statistics/root/usr/bin/stat-genconfig | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua index 3179da63b..bcee6efe0 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua @@ -20,6 +20,14 @@ hosts = s:option( Value, "Hosts", translate("Monitor hosts"), translate ("Add mu hosts.default = "127.0.0.1" hosts:depends( "enable", 1 ) +-- collectd_ping.adressfamily (AddressFamily) +addressfamily = s:option( ListValue, "AddressFamily", translate("Address family") ) +addressfamily.default = "any" +addressfamily:value( "any" ) +addressfamily:value( "ipv4" ) +addressfamily:value( "ipv6" ) +addressfamily:depends( "enable", 1 ) + -- collectd_ping.ttl (TTL) ttl = s:option( Value, "TTL", translate("TTL for ping packets") ) ttl.isinteger = true diff --git a/applications/luci-app-statistics/root/usr/bin/stat-genconfig b/applications/luci-app-statistics/root/usr/bin/stat-genconfig index 55cc6979e..cb091ae67 100755 --- a/applications/luci-app-statistics/root/usr/bin/stat-genconfig +++ b/applications/luci-app-statistics/root/usr/bin/stat-genconfig @@ -411,7 +411,7 @@ plugins = { }, ping = { - { "TTL", "Interval" }, + { "TTL", "Interval", "AddressFamily" }, { }, { "Hosts" } }, -- 2.25.1