summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/openvpn.lua
blob: 193f0448ae249b623cd683a5941cc5a07e049497 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
-- Copyright 2015 Jo-Philipp Wich <jow@openwrt.org>
-- Licensed to the public under the Apache License 2.0.

require "luci.sys"

local m, s, o


m = Map("luci_statistics",
	translate("OpenVPN Plugin Configuration"),
	translate("The OpenVPN plugin gathers information about the current vpn connection status."))

s = m:section( NamedSection, "collectd_openvpn", "luci_statistics" )


o = s:option( Flag, "enable", translate("Enable this plugin") )
o.default = "0"


o = s:option(Flag, "CollectIndividualUsers", translate("Generate a separate graph for each logged user"))
o.default = "0"
o.rmempty = true
o:depends("enable", 1)


o = s:option(Flag, "CollectUserCount", translate("Aggregate number of connected users"))
o.default = "0"
o.rmempty = true
o:depends("enable", 1)


o = s:option(Flag, "CollectCompression", translate("Gather compression statistics"))
o.default = "0"
o.rmempty = true
o:depends("enable", 1)


o = s:option(Flag, "ImprovedNamingSchema", translate("Use improved naming schema"))
o.default = "0"
o.rmempty = true
o:depends("enable", 1)


o = s:option(DynamicList, "StatusFile", translate("OpenVPN status files"))
o.rmempty = true
o:depends("enable", 1)

local status_files = nixio.fs.glob("/var/run/openvpn.*.status")
if status_files then
	local status_file
	for status_file in status_files do
		o:value(status_file)
	end
end

return m