luci-app-statistics: add address family configuration for ping 2779/head
authorLoïc Yhuel <loic.yhuel@gmail.com>
Fri, 21 Jun 2019 00:03:12 +0000 (02:03 +0200)
committerLoïc Yhuel <loic.yhuel@gmail.com>
Fri, 21 Jun 2019 00:03:12 +0000 (02:03 +0200)
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 <loic.yhuel@gmail.com>
applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua
applications/luci-app-statistics/root/usr/bin/stat-genconfig

index 3179da63b50050303884eaf2f12171ee904da91d..bcee6efe0890fb81f988cf04898dfd569f599ed9 100644 (file)
@@ -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
index 55cc6979e52d8006c62fcbc8f99c9d62968e1ab9..cb091ae6724cf5a007ba87a00fe72a879bba5166 100755 (executable)
@@ -411,7 +411,7 @@ plugins = {
        },
 
        ping    = {
-               { "TTL", "Interval" },
+               { "TTL", "Interval", "AddressFamily" },
                { },
                { "Hosts" }
        },