luci-app-statistics: add support for apcups plugin
[project/luci.git] / applications / luci-app-statistics / luasrc / model / cbi / luci_statistics / apcups.lua
1 -- Copyright 2015 Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
3
4 m = Map("luci_statistics",
5         translate("APCUPS Plugin Configuration"),
6         translate(
7                 "The APCUPS plugin collects statistics about the APC UPS."
8         ))
9
10 -- collectd_apcups config section
11 s = m:section( NamedSection, "collectd_apcups", "luci_statistics" )
12
13 -- collectd_apcups.enable
14 enable = s:option( Flag, "enable", translate("Enable this plugin") )
15 enable.default = 0
16
17 -- collectd_apcups.host (Host)
18 host = s:option( Value, "Host", translate("Monitor host"), translate ("Add multiple hosts separated by space."))
19 host.default = "localhost"
20 host:depends( "enable", 1 )
21
22 -- collectd_apcups.port (Port)
23 port = s:option( Value, "Port", translate("Port for apcupsd communication") )
24 port.isinteger = true
25 port.default   = 3551
26 port:depends( "enable", 1 )
27
28 return m