1 -- Copyright 2015 Jo-Philipp Wich <jow@openwrt.org>
2 -- Licensed to the public under the Apache License 2.0.
16 ["cpu_temp"] = "temperature",
17 ["fan1"] = "fanspeed",
18 ["fan2"] = "fanspeed",
19 ["fan3"] = "fanspeed",
20 ["fan4"] = "fanspeed",
21 ["fan5"] = "fanspeed",
22 ["fan6"] = "fanspeed",
23 ["fan7"] = "fanspeed",
35 ["remote_temp"] = "temperature",
36 ["temp1"] = "temperature",
37 ["temp2"] = "temperature",
38 ["temp3"] = "temperature",
39 ["temp4"] = "temperature",
40 ["temp5"] = "temperature",
41 ["temp6"] = "temperature",
42 ["temp7"] = "temperature",
43 ["temp"] = "temperature",
44 ["vccp1"] = "voltage",
45 ["vccp2"] = "voltage",
57 ["volt12"] = "voltage",
58 ["volt5"] = "voltage",
59 ["voltbatt"] = "voltage",
65 m = Map("luci_statistics",
66 translate("Sensors Plugin Configuration"),
67 translate("The sensors plugin uses the Linux Sensors framework to gather environmental statistics."))
69 s = m:section( NamedSection, "collectd_sensors", "luci_statistics" )
72 o = s:option( Flag, "enable", translate("Enable this plugin") )
76 o = s:option(Flag, "__all", translate("Monitor all sensors"))
77 o:depends("enable", 1)
79 o.write = function() end
80 o.cfgvalue = function(self, sid)
81 local v = self.map:get(sid, "Sensor")
82 if v == nil or (type(v) == "table" and #v == 0) or (type(v) == "string" and #v == 0) then
88 o = s:option(MultiValue, "Sensor", translate("Sensor list"), translate("Hold Ctrl to select multiple items or to deselect entries."))
89 o:depends({enable = 1, __all = "" })
94 local sensorcli = io.popen("/usr/sbin/sensors -u -A")
99 local ln = sensorcli:read("*ln")
102 elseif ln:match("^[%w-]+$") then
104 elseif ln:match("^[%w-]+:$") then
105 sensor = ln:sub(0, -2):lower()
106 if bus and sensor_types[sensor] then
107 o:value("%s/%s-%s" %{ bus, sensor_types[sensor], sensor })
120 o = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
123 o:depends({ enable = 1, __all = "" })