From caae7adfaaf2ecce3499dd63af21cc612a68f60a Mon Sep 17 00:00:00 2001 From: Hannu Nyman Date: Sun, 13 Dec 2020 12:39:24 +0200 Subject: [PATCH] luci-app-statistics: Adjust UI defaults to match config file Adjust the defaults shown in the LuCI user interface to match the real default values in the default config file. (If a plugin is disabled and config values get deleted from the config file, user has been offered incorrect default values from UI defaults when the plugin is later re-enabled.) * email: socket in /var/run/collectd/ dir * ping: TTL 127 * rrdtool: 3600 sec (1hour) as shortest period, 144 RRArows * unixsock: socket in /var/run/collectd/ dir Signed-off-by: Hannu Nyman (Backported and adapted from commit f7e5b56649) --- .../luasrc/model/cbi/luci_statistics/email.lua | 2 +- .../luasrc/model/cbi/luci_statistics/ping.lua | 2 +- .../luasrc/model/cbi/luci_statistics/rrdtool.lua | 4 ++-- .../luasrc/model/cbi/luci_statistics/unixsock.lua | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/email.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/email.lua index e6ed4392f1..1cdb614b7b 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/email.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/email.lua @@ -20,7 +20,7 @@ enable.default = 0 -- collectd_email.socketfile (SocketFile) socketfile = s:option( Value, "SocketFile", translate("Socket file") ) -socketfile.default = "/var/run/collect-email.sock" +socketfile.default = "/var/run/collectd/email.sock" socketfile:depends( "enable", 1 ) -- collectd_email.socketgroup (SocketGroup) 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 bcee6efe08..6f8553cd22 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 @@ -31,7 +31,7 @@ addressfamily:depends( "enable", 1 ) -- collectd_ping.ttl (TTL) ttl = s:option( Value, "TTL", translate("TTL for ping packets") ) ttl.isinteger = true -ttl.default = 128 +ttl.default = 127 ttl:depends( "enable", 1 ) -- collectd_ping.interval (Interval) diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/rrdtool.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/rrdtool.lua index fa00bbbf5e..b743cc9b46 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/rrdtool.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/rrdtool.lua @@ -65,7 +65,7 @@ rramax:depends( "RRASingle", 0 ) -- collectd_rrdtool.rratimespans (RRATimespan) rratimespans = s:option( Value, "RRATimespans", translate("Stored timespans"), translate("seconds; multiple separated by space") ) -rratimespans.default = "600 86400 604800 2678400 31622400" +rratimespans.default = "3600 86400 604800 2678400 31622400" rratimespans.rmempty = true rratimespans.optional = true rratimespans:depends( "enable", 1 ) @@ -73,7 +73,7 @@ rratimespans:depends( "enable", 1 ) -- collectd_rrdtool.rrarows (RRARows) rrarows = s:option( Value, "RRARows", translate("Rows per RRA") ) rrarows.isinteger = true -rrarows.default = 100 +rrarows.default = 144 rrarows.rmempty = true rrarows.optional = true rrarows:depends( "enable", 1 ) diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/unixsock.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/unixsock.lua index be79543b22..aa21312110 100644 --- a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/unixsock.lua +++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/unixsock.lua @@ -17,7 +17,7 @@ enable.default = 0 -- collectd_unixsock.socketfile (SocketFile) socketfile = s:option( Value, "SocketFile" ) -socketfile.default = "/var/run/collect-query.socket" +socketfile.default = "/var/run/collectd/query.sock" socketfile:depends( "enable", 1 ) -- collectd_unixsock.socketgroup (SocketGroup) -- 2.30.2