summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-statistics/luasrc/model/cbi
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2014-12-03 15:17:05 +0100
committerJo-Philipp Wich <jow@openwrt.org>2015-01-08 16:26:20 +0100
commit1bb4822dca6113f73e3bc89e2acf15935e6f8e92 (patch)
tree35e16f100466e4e00657199b38bb3d87d52bf73f /applications/luci-app-statistics/luasrc/model/cbi
parent9edd0e46c3f880727738ce8ca6ff1c8b85f99ef4 (diff)
Rework LuCI build system
* Rename subdirectories to their repective OpenWrt package names * Make each LuCI module its own standalone package * Deploy a shared luci.mk which is used by each module Makefile Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Diffstat (limited to 'applications/luci-app-statistics/luasrc/model/cbi')
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/collectd.lua74
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/conntrack.lua21
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua27
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/csv.lua41
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/df.lua53
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/disk.lua41
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/dns.lua48
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/email.lua60
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/exec.lua89
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/interface.lua47
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iptables.lua132
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/irq.lua42
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iwinfo.lua38
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/load.lua29
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/memory.lua21
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/netlink.lua95
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/network.lua98
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/nut.lua28
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/olsrd.lua54
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua47
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/processes.lua36
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/rrdtool.lua108
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/splash_leases.lua24
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/tcpconns.lua45
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/unixsock.lua49
-rw-r--r--applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/uptime.lua22
26 files changed, 1369 insertions, 0 deletions
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/collectd.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/collectd.lua
new file mode 100644
index 0000000000..2343854f66
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/collectd.lua
@@ -0,0 +1,74 @@
+--[[
+
+Luci configuration model for statistics - general collectd configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+require("luci.sys")
+
+
+m = Map("luci_statistics",
+ translate("Collectd Settings"),
+ translate(
+ "Collectd is a small daemon for collecting data from " ..
+ "various sources through different plugins. On this page " ..
+ "you can change general settings for the collectd daemon."
+ ))
+
+-- general config section
+s = m:section( NamedSection, "collectd", "luci_statistics" )
+
+-- general.hostname (Hostname)
+hostname = s:option( Value, "Hostname", translate("Hostname") )
+hostname.default = luci.sys.hostname()
+hostname.optional = true
+
+-- general.basedir (BaseDir)
+basedir = s:option( Value, "BaseDir", translate("Base Directory") )
+basedir.default = "/var/run/collectd"
+
+-- general.include (Include)
+include = s:option( Value, "Include", translate("Directory for sub-configurations") )
+include.default = "/etc/collectd/conf.d/*.conf"
+
+-- general.plugindir (PluginDir)
+plugindir = s:option( Value, "PluginDir", translate("Directory for collectd plugins") )
+plugindir.default = "/usr/lib/collectd/"
+
+-- general.pidfile (PIDFile)
+pidfile = s:option( Value, "PIDFile", translate("Used PID file") )
+pidfile.default = "/var/run/collectd.pid"
+
+-- general.typesdb (TypesDB)
+typesdb = s:option( Value, "TypesDB", translate("Datasets definition file") )
+typesdb.default = "/etc/collectd/types.db"
+
+-- general.interval (Interval)
+interval = s:option( Value, "Interval", translate("Data collection interval"), translate("Seconds") )
+interval.default = 60
+interval.isnumber = true
+
+-- general.readthreads (ReadThreads)
+readthreads = s:option( Value, "ReadThreads", translate("Number of threads for data collection") )
+readthreads.default = 5
+readthreads.isnumber = true
+
+-- general.fqdnlookup (FQDNLookup)
+fqdnlookup = s:option( Flag, "FQDNLookup", translate("Try to lookup fully qualified hostname") )
+fqdnlookup.enabled = "true"
+fqdnlookup.disabled = "false"
+fqdnlookup.default = "false"
+fqdnlookup.optional = true
+fqdnlookup:depends( "Hostname", "" )
+
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/conntrack.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/conntrack.lua
new file mode 100644
index 0000000000..81e9c05a55
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/conntrack.lua
@@ -0,0 +1,21 @@
+--[[
+
+Copyright 2011 Jo-Philipp Wich <xm@subsignal.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
+m = Map("luci_statistics",
+ translate("Conntrack Plugin Configuration"),
+ translate("The conntrack plugin collects statistics about the number of tracked connections."))
+
+s = m:section( NamedSection, "collectd_conntrack", "luci_statistics" )
+
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua
new file mode 100644
index 0000000000..26d5f07c84
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/cpu.lua
@@ -0,0 +1,27 @@
+--[[
+
+Luci configuration model for statistics - collectd cpu plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("CPU Plugin Configuration"),
+ translate("The cpu plugin collects basic statistics about the processor usage."))
+
+-- collectd_cpu config section
+s = m:section( NamedSection, "collectd_cpu", "luci_statistics" )
+
+-- collectd_cpu.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/csv.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/csv.lua
new file mode 100644
index 0000000000..4f5aeef1d0
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/csv.lua
@@ -0,0 +1,41 @@
+--[[
+
+Luci configuration model for statistics - collectd csv plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("CSV Plugin Configuration"),
+ translate(
+ "The csv plugin stores collected data in csv file format " ..
+ "for further processing by external programs."
+ ))
+
+-- collectd_csv config section
+s = m:section( NamedSection, "collectd_csv", "luci_statistics" )
+
+-- collectd_csv.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_csv.datadir (DataDir)
+datadir = s:option( Value, "DataDir", translate("Storage directory for the csv files") )
+datadir.default = "127.0.0.1"
+datadir:depends( "enable", 1 )
+
+-- collectd_csv.storerates (StoreRates)
+storerates = s:option( Flag, "StoreRates", translate("Store data values as rates instead of absolute values") )
+storerates.default = 0
+storerates:depends( "enable", 1 )
+
+return m
+
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/df.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/df.lua
new file mode 100644
index 0000000000..1a3245fc04
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/df.lua
@@ -0,0 +1,53 @@
+--[[
+
+Luci configuration model for statistics - collectd df plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("DF Plugin Configuration"),
+ translate(
+ "The df plugin collects statistics about the disk space " ..
+ "usage on different devices, mount points or filesystem types."
+ ))
+
+-- collectd_df config section
+s = m:section( NamedSection, "collectd_df", "luci_statistics" )
+
+-- collectd_df.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_df.devices (Device)
+devices = s:option( Value, "Devices", translate("Monitor devices") )
+devices.default = "/dev/mtdblock/4"
+devices.optional = true
+devices:depends( "enable", 1 )
+
+-- collectd_df.mountpoints (MountPoint)
+mountpoints = s:option( Value, "MountPoints", translate("Monitor mount points") )
+mountpoints.default = "/overlay"
+mountpoints.optional = true
+mountpoints:depends( "enable", 1 )
+
+-- collectd_df.fstypes (FSType)
+fstypes = s:option( Value, "FSTypes", translate("Monitor filesystem types") )
+fstypes.default = "tmpfs"
+fstypes.optional = true
+fstypes:depends( "enable", 1 )
+
+-- collectd_df.ignoreselected (IgnoreSelected)
+ignoreselected = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
+ignoreselected.default = 0
+ignoreselected:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/disk.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/disk.lua
new file mode 100644
index 0000000000..7592b44403
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/disk.lua
@@ -0,0 +1,41 @@
+--[[
+
+Luci configuration model for statistics - collectd disk plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("Disk Plugin Configuration"),
+ translate(
+ "The disk plugin collects detailled usage statistics " ..
+ "for selected partitions or whole disks."
+ ))
+
+-- collectd_disk config section
+s = m:section( NamedSection, "collectd_disk", "luci_statistics" )
+
+-- collectd_disk.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_disk.disks (Disk)
+devices = s:option( Value, "Disks", translate("Monitor disks and partitions") )
+devices.default = "hda1 hdb"
+devices.rmempty = true
+devices:depends( "enable", 1 )
+
+-- collectd_disk.ignoreselected (IgnoreSelected)
+ignoreselected = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
+ignoreselected.default = 0
+ignoreselected:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/dns.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/dns.lua
new file mode 100644
index 0000000000..28d9e5de33
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/dns.lua
@@ -0,0 +1,48 @@
+--[[
+
+Luci configuration model for statistics - collectd dns plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+require("luci.sys")
+
+
+m = Map("luci_statistics",
+ translate("DNS Plugin Configuration"),
+ translate(
+ "The dns plugin collects detailled statistics about dns " ..
+ "related traffic on selected interfaces."
+ ))
+
+-- collectd_dns config section
+s = m:section( NamedSection, "collectd_dns", "luci_statistics" )
+
+-- collectd_dns.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_dns.interfaces (Interface)
+interfaces = s:option( MultiValue, "Interfaces", translate("Monitor interfaces") )
+interfaces.widget = "select"
+interfaces.size = 5
+interfaces:depends( "enable", 1 )
+interfaces:value("any")
+for k, v in pairs(luci.sys.net.devices()) do
+ interfaces:value(v)
+end
+
+-- collectd_dns.ignoresources (IgnoreSource)
+ignoresources = s:option( Value, "IgnoreSources", translate("Ignore source addresses") )
+ignoresources.default = "127.0.0.1"
+ignoresources:depends( "enable", 1 )
+
+return m
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
new file mode 100644
index 0000000000..c5733d8cf8
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/email.lua
@@ -0,0 +1,60 @@
+--[[
+
+Luci configuration model for statistics - collectd email plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("E-Mail Plugin Configuration"),
+ translate(
+ "The email plugin creates a unix socket which can be used " ..
+ "to transmit email-statistics to a running collectd daemon. " ..
+ "This plugin is primarily intended to be used in conjunction " ..
+ "with Mail::SpamAssasin::Plugin::Collectd but can be used in " ..
+ "other ways as well."
+ ))
+
+-- collectd_email config section
+s = m:section( NamedSection, "collectd_email", "luci_statistics" )
+
+-- collectd_email.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_email.socketfile (SocketFile)
+socketfile = s:option( Value, "SocketFile", translate("Socket file") )
+socketfile.default = "/var/run/collect-email.sock"
+socketfile:depends( "enable", 1 )
+
+-- collectd_email.socketgroup (SocketGroup)
+socketgroup = s:option( Value, "SocketGroup", translate("Socket group") )
+socketgroup.default = "nobody"
+socketgroup.rmempty = true
+socketgroup.optional = true
+socketgroup:depends( "enable", 1 )
+
+-- collectd_email.socketperms (SocketPerms)
+socketperms = s:option( Value, "SocketPerms", translate("Socket permissions") )
+socketperms.default = "0770"
+socketperms.rmempty = true
+socketperms.optional = true
+socketperms:depends( "enable", 1 )
+
+-- collectd_email.maxconns (MaxConns)
+maxconns = s:option( Value, "MaxConns", translate("Maximum allowed connections") )
+maxconns.default = 5
+maxconns.isinteger = true
+maxconns.rmempty = true
+maxconns.optional = true
+maxconns:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/exec.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/exec.lua
new file mode 100644
index 0000000000..997d455d9a
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/exec.lua
@@ -0,0 +1,89 @@
+--[[
+
+Luci configuration model for statistics - collectd exec plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("Exec Plugin Configuration"),
+ translate(
+ "The exec plugin starts external commands to read values " ..
+ "from or to notify external processes when certain threshold " ..
+ "values have been reached."
+ ))
+
+-- collectd_exec config section
+s = m:section( NamedSection, "collectd_exec", "luci_statistics" )
+
+-- collectd_exec.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+
+-- collectd_exec_input config section (Exec directives)
+exec = m:section( TypedSection, "collectd_exec_input",
+ translate("Add command for reading values"),
+ translate(
+ "Here you can define external commands which will be " ..
+ "started by collectd in order to read certain values. " ..
+ "The values will be read from stdout."
+ ))
+exec.addremove = true
+exec.anonymous = true
+
+-- collectd_exec_input.cmdline
+exec_cmdline = exec:option( Value, "cmdline", translate("Script") )
+exec_cmdline.default = "/usr/bin/stat-dhcpusers"
+
+-- collectd_exec_input.cmdline
+exec_cmduser = exec:option( Value, "cmduser", translate("User") )
+exec_cmduser.default = "nobody"
+exec_cmduser.rmempty = true
+exec_cmduser.optional = true
+
+-- collectd_exec_input.cmdline
+exec_cmdgroup = exec:option( Value, "cmdgroup", translate("Group") )
+exec_cmdgroup.default = "nogroup"
+exec_cmdgroup.rmempty = true
+exec_cmdgroup.optional = true
+
+
+-- collectd_exec_notify config section (NotifyExec directives)
+notify = m:section( TypedSection, "collectd_exec_notify",
+ translate("Add notification command"),
+ translate(
+ "Here you can define external commands which will be " ..
+ "started by collectd when certain threshold values have " ..
+ "been reached. The values leading to invokation will be " ..
+ "feeded to the the called programs stdin."
+ ))
+notify.addremove = true
+notify.anonymous = true
+
+-- collectd_notify_input.cmdline
+notify_cmdline = notify:option( Value, "cmdline", translate("Script") )
+notify_cmdline.default = "/usr/bin/stat-dhcpusers"
+
+-- collectd_notify_input.cmdline
+notify_cmduser = notify:option( Value, "cmduser", translate("User") )
+notify_cmduser.default = "nobody"
+notify_cmduser.rmempty = true
+notify_cmduser.optional = true
+
+-- collectd_notify_input.cmdline
+notify_cmdgroup = notify:option( Value, "cmdgroup", translate("Group") )
+notify_cmdgroup.default = "nogroup"
+notify_cmdgroup.rmempty = true
+notify_cmdgroup.optional = true
+
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/interface.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/interface.lua
new file mode 100644
index 0000000000..dbb3e9dc06
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/interface.lua
@@ -0,0 +1,47 @@
+--[[
+
+Luci configuration model for statistics - collectd interface plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+require("luci.sys")
+
+
+m = Map("luci_statistics",
+ translate("Interface Plugin Configuration"),
+ translate(
+ "The interface plugin collects traffic statistics on " ..
+ "selected interfaces."
+ ))
+
+-- collectd_interface config section
+s = m:section( NamedSection, "collectd_interface", "luci_statistics" )
+
+-- collectd_interface.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_interface.interfaces (Interface)
+interfaces = s:option( MultiValue, "Interfaces", translate("Monitor interfaces") )
+interfaces.widget = "select"
+interfaces.size = 5
+interfaces:depends( "enable", 1 )
+for k, v in pairs(luci.sys.net.devices()) do
+ interfaces:value(v)
+end
+
+-- collectd_interface.ignoreselected (IgnoreSelected)
+ignoreselected = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
+ignoreselected.default = 0
+ignoreselected:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iptables.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iptables.lua
new file mode 100644
index 0000000000..1f7341c46e
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iptables.lua
@@ -0,0 +1,132 @@
+--[[
+
+Luci configuration model for statistics - collectd iptables plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+require("luci.sys.iptparser")
+
+ip = luci.sys.iptparser.IptParser()
+chains = { }
+targets = { }
+
+for i, rule in ipairs( ip:find() ) do
+ if rule.chain and rule.target then
+ chains[rule.chain] = true
+ targets[rule.target] = true
+ end
+end
+
+
+m = Map("luci_statistics",
+ translate("Iptables Plugin Configuration"),
+ translate(
+ "The iptables plugin will monitor selected firewall rules and " ..
+ "collect informations about processed bytes and packets per rule."
+ ))
+
+-- collectd_iptables config section
+s = m:section( NamedSection, "collectd_iptables", "luci_statistics" )
+
+-- collectd_iptables.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+
+-- collectd_iptables_match config section (Chain directives)
+rule = m:section( TypedSection, "collectd_iptables_match",
+ translate("Add matching rule"),
+ translate(
+ "Here you can define various criteria by which the monitored " ..
+ "iptables rules are selected."
+ ))
+rule.addremove = true
+rule.anonymous = true
+
+
+-- collectd_iptables_match.name
+rule_table = rule:option( Value, "name",
+ translate("Name of the rule"), translate("max. 16 chars") )
+
+-- collectd_iptables_match.table
+rule_table = rule:option( ListValue, "table", translate("Table") )
+rule_table.default = "filter"
+rule_table.rmempty = true
+rule_table.optional = true
+rule_table:value("")
+rule_table:value("filter")
+rule_table:value("nat")
+rule_table:value("mangle")
+
+
+-- collectd_iptables_match.chain
+rule_chain = rule:option( ListValue, "chain", translate("Chain") )
+rule_chain.rmempty = true
+rule_chain.optional = true
+rule_chain:value("")
+
+for chain, void in pairs( chains ) do
+ rule_chain:value( chain )
+end
+
+
+-- collectd_iptables_match.target
+rule_target = rule:option( ListValue, "target", translate("Action (target)") )
+rule_target.rmempty = true
+rule_target.optional = true
+rule_target:value("")
+
+for target, void in pairs( targets ) do
+ rule_target:value( target )
+end
+
+
+-- collectd_iptables_match.protocol
+rule_protocol = rule:option( ListValue, "protocol", translate("Network protocol") )
+rule_protocol.rmempty = true
+rule_protocol.optional = true
+rule_protocol:value("")
+rule_protocol:value("tcp")
+rule_protocol:value("udp")
+rule_protocol:value("icmp")
+
+-- collectd_iptables_match.source
+rule_source = rule:option( Value, "source", translate("Source ip range") )
+rule_source.default = "0.0.0.0/0"
+rule_source.rmempty = true
+rule_source.optional = true
+
+-- collectd_iptables_match.destination
+rule_destination = rule:option( Value, "destination", translate("Destination ip range") )
+rule_destination.default = "0.0.0.0/0"
+rule_destination.rmempty = true
+rule_destination.optional = true
+
+-- collectd_iptables_match.inputif
+rule_inputif = rule:option( Value, "inputif",
+ translate("Incoming interface"), translate("e.g. br-lan") )
+rule_inputif.rmempty = true
+rule_inputif.optional = true
+
+-- collectd_iptables_match.outputif
+rule_outputif = rule:option( Value, "outputif",
+ translate("Outgoing interface"), translate("e.g. br-ff") )
+rule_outputif.rmempty = true
+rule_outputif.optional = true
+
+-- collectd_iptables_match.options
+rule_options = rule:option( Value, "options",
+ translate("Options"), translate("e.g. reject-with tcp-reset") )
+rule_options.rmempty = true
+rule_options.optional = true
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/irq.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/irq.lua
new file mode 100644
index 0000000000..d6aa2e96c3
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/irq.lua
@@ -0,0 +1,42 @@
+--[[
+
+Luci configuration model for statistics - collectd irq plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("IRQ Plugin Configuration"),
+ translate(
+ "The irq plugin will monitor the rate of issues per second for " ..
+ "each selected interrupt. If no interrupt is selected then all " ..
+ "interrupts are monitored."
+ ))
+
+-- collectd_irq config section
+s = m:section( NamedSection, "collectd_irq", "luci_statistics" )
+
+-- collectd_irq.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_irq.irqs (Irq)
+irqs = s:option( Value, "Irqs", translate("Monitor interrupts") )
+irqs.optional = true
+irqs:depends( "enable", 1 )
+
+-- collectd_irq.ignoreselected (IgnoreSelected)
+ignoreselected = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
+ignoreselected.default = 0
+ignoreselected.optional = "true"
+ignoreselected:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iwinfo.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iwinfo.lua
new file mode 100644
index 0000000000..5e9340dc46
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/iwinfo.lua
@@ -0,0 +1,38 @@
+--[[
+
+Luci configuration model for statistics - collectd interface plugin configuration
+(c) 2011 Jo-Philipp Wich <xm@subsignal.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+local m, s, o
+
+m = Map("luci_statistics",
+ translate("Wireless iwinfo Plugin Configuration"),
+ translate("The iwinfo plugin collects statistics about wireless signal strength, noise and quality."))
+
+s = m:section(NamedSection, "collectd_iwinfo", "luci_statistics")
+
+o = s:option(Flag, "enable", translate("Enable this plugin"))
+o.default = 0
+
+o = s:option(Value, "Interfaces", translate("Monitor interfaces"),
+ translate("Leave unselected to automatically determine interfaces to monitor."))
+o.template = "cbi/network_ifacelist"
+o.widget = "checkbox"
+o.nocreate = true
+o:depends("enable", 1)
+
+o = s:option(Flag, "IgnoreSelected", translate("Monitor all except specified"))
+o.default = 0
+o:depends("enable", 1)
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/load.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/load.lua
new file mode 100644
index 0000000000..e59a4b8f7e
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/load.lua
@@ -0,0 +1,29 @@
+--[[
+
+Luci configuration model for statistics - collectd load plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("Load Plugin Configuration"),
+ translate(
+ "The load plugin collects statistics about the general system load."
+ ))
+
+-- collectd_wireless config section
+s = m:section( NamedSection, "collectd_load", "luci_statistics" )
+
+-- collectd_wireless.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/memory.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/memory.lua
new file mode 100644
index 0000000000..5510a5a8e8
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/memory.lua
@@ -0,0 +1,21 @@
+--[[
+
+Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
+m = Map("luci_statistics",
+ translate("Memory Plugin Configuration"),
+ translate("The memory plugin collects statistics about the memory usage."))
+
+s = m:section( NamedSection, "collectd_memory", "luci_statistics" )
+
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/netlink.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/netlink.lua
new file mode 100644
index 0000000000..3417d0902d
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/netlink.lua
@@ -0,0 +1,95 @@
+--[[
+
+Luci configuration model for statistics - collectd netlink plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+require("luci.sys")
+
+local devices = luci.sys.net.devices()
+
+
+m = Map("luci_statistics",
+ translate("Netlink Plugin Configuration"),
+ translate(
+ "The netlink plugin collects extended informations like " ..
+ "qdisc-, class- and filter-statistics for selected interfaces."
+ ))
+
+-- collectd_netlink config section
+s = m:section( NamedSection, "collectd_netlink", "luci_statistics" )
+
+-- collectd_netlink.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_netlink.interfaces (Interface)
+interfaces = s:option( MultiValue, "Interfaces", translate("Basic monitoring") )
+interfaces.widget = "select"
+interfaces.optional = true
+interfaces.size = #devices + 1
+interfaces:depends( "enable", 1 )
+interfaces:value("")
+for i, v in ipairs(devices) do
+ interfaces:value(v)
+end
+
+-- collectd_netlink.verboseinterfaces (VerboseInterface)
+verboseinterfaces = s:option( MultiValue, "VerboseInterfaces", translate("Verbose monitoring") )
+verboseinterfaces.widget = "select"
+verboseinterfaces.optional = true
+verboseinterfaces.size = #devices + 1
+verboseinterfaces:depends( "enable", 1 )
+verboseinterfaces:value("")
+for i, v in ipairs(devices) do
+ verboseinterfaces:value(v)
+end
+
+-- collectd_netlink.qdiscs (QDisc)
+qdiscs = s:option( MultiValue, "QDiscs", translate("Qdisc monitoring") )
+qdiscs.widget = "select"
+qdiscs.optional = true
+qdiscs.size = #devices + 1
+qdiscs:depends( "enable", 1 )
+qdiscs:value("")
+for i, v in ipairs(devices) do
+ qdiscs:value(v)
+end
+
+-- collectd_netlink.classes (Class)
+classes = s:option( MultiValue, "Classes", translate("Shaping class monitoring") )
+classes.widget = "select"
+classes.optional = true
+classes.size = #devices + 1
+classes:depends( "enable", 1 )
+classes:value("")
+for i, v in ipairs(devices) do
+ classes:value(v)
+end
+
+-- collectd_netlink.filters (Filter)
+filters = s:option( MultiValue, "Filters", translate("Filter class monitoring") )
+filters.widget = "select"
+filters.optional = true
+filters.size = #devices + 1
+filters:depends( "enable", 1 )
+filters:value("")
+for i, v in ipairs(devices) do
+ filters:value(v)
+end
+
+-- collectd_netlink.ignoreselected (IgnoreSelected)
+ignoreselected = s:option( Flag, "IgnoreSelected", translate("Monitor all except specified") )
+ignoreselected.default = 0
+ignoreselected:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/network.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/network.lua
new file mode 100644
index 0000000000..8a0068973e
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/network.lua
@@ -0,0 +1,98 @@
+--[[
+
+Luci configuration model for statistics - collectd network plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+
+m = Map("luci_statistics",
+ translate("Network Plugin Configuration"),
+ translate(
+ "The network plugin provides network based communication between " ..
+ "different collectd instances. Collectd can operate both in client " ..
+ "and server mode. In client mode locally collected date is " ..
+ "transferred to a collectd server instance, in server mode the " ..
+ "local instance receives data from other hosts."
+ ))
+
+-- collectd_network config section
+s = m:section( NamedSection, "collectd_network", "luci_statistics" )
+
+-- collectd_network.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+
+-- collectd_network_listen config section (Listen)
+listen = m:section( TypedSection, "collectd_network_listen",
+ translate("Listener interfaces"),
+ translate(
+ "This section defines on which interfaces collectd will wait " ..
+ "for incoming connections."
+ ))
+listen.addremove = true
+listen.anonymous = true
+
+-- collectd_network_listen.host
+listen_host = listen:option( Value, "host", translate("Listen host") )
+listen_host.default = "0.0.0.0"
+
+-- collectd_network_listen.port
+listen_port = listen:option( Value, "port", translate("Listen port") )
+listen_port.default = 25826
+listen_port.isinteger = true
+listen_port.optional = true
+
+
+-- collectd_network_server config section (Server)
+server = m:section( TypedSection, "collectd_network_server",
+ translate("server interfaces"),
+ translate(
+ "This section defines to which servers the locally collected " ..
+ "data is sent to."
+ ))
+server.addremove = true
+server.anonymous = true
+
+-- collectd_network_server.host
+server_host = server:option( Value, "host", translate("Server host") )
+server_host.default = "0.0.0.0"
+
+-- collectd_network_server.port
+server_port = server:option( Value, "port", translate("Server port") )
+server_port.default = 25826
+server_port.isinteger = true
+server_port.optional = true
+
+-- collectd_network.timetolive (TimeToLive)
+ttl = s:option( Value, "TimeToLive", translate("TTL for network packets") )
+ttl.default = 128
+ttl.isinteger = true
+ttl.optional = true
+ttl:depends( "enable", 1 )
+
+-- collectd_network.forward (Forward)
+forward = s:option( Flag, "Forward", translate("Forwarding between listen and server addresses") )
+forward.default = 0
+forward.optional = true
+forward:depends( "enable", 1 )
+
+-- collectd_network.cacheflush (CacheFlush)
+cacheflush = s:option( Value, "CacheFlush",
+ translate("Cache flush interval"), translate("Seconds") )
+cacheflush.default = 86400
+cacheflush.isinteger = true
+cacheflush.optional = true
+cacheflush:depends( "enable", 1 )
+
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/nut.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/nut.lua
new file mode 100644
index 0000000000..ad030718cf
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/nut.lua
@@ -0,0 +1,28 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright © 2011 Manuel Munz <freifunk at somakoma dot de>
+Copyright © 2012 David Woodhouse <dwmw2@infradead.org>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
+m = Map("luci_statistics",
+ translate("UPS Plugin Configuration"),
+ translate("The NUT plugin reads information about Uninterruptible Power Supplies."))
+
+s = m:section(NamedSection, "collectd_nut", "luci_statistics" )
+
+enable = s:option(Flag, "enable", translate("Enable this plugin"))
+enable.default = 0
+
+host = s:option(Value, "UPS", translate("UPS"), translate("UPS name in NUT ups@host format"))
+host.placeholder = "myupsname"
+host.datatype = "string"
+host.rmempty = true
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/olsrd.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/olsrd.lua
new file mode 100644
index 0000000000..e3eb7b2c4b
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/olsrd.lua
@@ -0,0 +1,54 @@
+--[[
+LuCI - Lua Configuration Interface
+
+Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
+m = Map("luci_statistics",
+ translate("OLSRd Plugin Configuration"),
+ translate("The OLSRd plugin reads information about meshed networks from the txtinfo plugin of OLSRd."))
+
+s = m:section(NamedSection, "collectd_olsrd", "luci_statistics" )
+
+enable = s:option(Flag, "enable", translate("Enable this plugin"))
+enable.default = 0
+
+host = s:option(Value, "Host", translate("Host"), translate("IP or hostname where to get the txtinfo output from"))
+host.placeholder = "127.0.0.1"
+host.datatype = "host"
+host.rmempty = true
+
+port = s:option(Value, "Port", translate("Port"))
+port.placeholder = "2006"
+port.datatype = "range(0,65535)"
+port.rmempty = true
+port.cast = "string"
+
+cl = s:option(ListValue, "CollectLinks", translate("CollectLinks"),
+ translate("Specifies what information to collect about links."))
+cl:value("No")
+cl:value("Summary")
+cl:value("Detail")
+cl.default = "Detail"
+
+cr = s:option(ListValue, "CollectRoutes", translate("CollectRoutes"),
+ translate("Specifies what information to collect about routes."))
+cr:value("No")
+cr:value("Summary")
+cr:value("Detail")
+cr.default = "Summary"
+
+ct = s:option(ListValue, "CollectTopology", translate("CollectTopology"),
+ translate("Specifies what information to collect about the global topology."))
+ct:value("No")
+ct:value("Summary")
+ct:value("Detail")
+ct.default = "Summary"
+
+return m
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
new file mode 100644
index 0000000000..c55ac87368
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/ping.lua
@@ -0,0 +1,47 @@
+--[[
+
+Luci configuration model for statistics - collectd ping plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("Ping Plugin Configuration"),
+ translate(
+ "The ping plugin will send icmp echo replies to selected " ..
+ "hosts and measure the roundtrip time for each host."
+ ))
+
+-- collectd_ping config section
+s = m:section( NamedSection, "collectd_ping", "luci_statistics" )
+
+-- collectd_ping.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_ping.hosts (Host)
+hosts = s:option( Value, "Hosts", translate("Monitor hosts"), translate ("Add multiple hosts separated by space."))
+hosts.default = "127.0.0.1"
+hosts:depends( "enable", 1 )
+
+-- collectd_ping.ttl (TTL)
+ttl = s:option( Value, "TTL", translate("TTL for ping packets") )
+ttl.isinteger = true
+ttl.default = 128
+ttl:depends( "enable", 1 )
+
+-- collectd_ping.interval (Interval)
+interval = s:option( Value, "Interval", translate("Interval for pings"), translate ("Seconds") )
+interval.isinteger = true
+interval.default = 30
+interval:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/processes.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/processes.lua
new file mode 100644
index 0000000000..3aea6b3c71
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/processes.lua
@@ -0,0 +1,36 @@
+--[[
+
+Luci configuration model for statistics - collectd processes plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("Processes Plugin Configuration"),
+ translate(
+ "The processes plugin collects informations like cpu time, " ..
+ "page faults and memory usage of selected processes."
+ ))
+
+-- collectd_processes config section
+s = m:section( NamedSection, "collectd_processes", "luci_statistics" )
+
+-- collectd_processes.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_processes.processes (Process)
+processes = s:option( Value, "Processes", translate("Monitor processes"),
+ translate("Processes to monitor separated by space") )
+processes:depends( "enable", 1 )
+processes.default = "uhttpd dropbear dnsmasq"
+
+return m
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
new file mode 100644
index 0000000000..75716341c8
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/rrdtool.lua
@@ -0,0 +1,108 @@
+--[[
+
+Luci configuration model for statistics - collectd rrdtool plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("RRDTool Plugin Configuration"),
+ translate(
+ "The rrdtool plugin stores the collected data in rrd database " ..
+ "files, the foundation of the diagrams.<br /><br />" ..
+ "<strong>Warning: Setting the wrong values will result in a very " ..
+ "high memory consumption in the temporary directory. " ..
+ "This can render the device unusable!</strong>"
+ ))
+
+-- collectd_rrdtool config section
+s = m:section( NamedSection, "collectd_rrdtool", "luci_statistics" )
+
+-- collectd_rrdtool.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 1
+
+-- collectd_rrdtool.datadir (DataDir)
+datadir = s:option( Value, "DataDir", translate("Storage directory") )
+datadir.default = "/tmp"
+datadir.rmempty = true
+datadir.optional = true
+datadir:depends( "enable", 1 )
+
+-- collectd_rrdtool.stepsize (StepSize)
+stepsize = s:option( Value, "StepSize",
+ translate("RRD step interval"), translate("Seconds") )
+stepsize.default = 30
+stepsize.isinteger = true
+stepsize.rmempty = true
+stepsize.optional = true
+stepsize:depends( "enable", 1 )
+
+-- collectd_rrdtool.heartbeat (HeartBeat)
+heartbeat = s:option( Value, "HeartBeat",
+ translate("RRD heart beat interval"), translate("Seconds") )
+heartbeat.default = 60
+heartbeat.isinteger = true
+heartbeat.rmempty = true
+heartbeat.optional = true
+heartbeat:depends( "enable", 1 )
+
+-- collectd_rrdtool.rrasingle (RRASingle)
+rrasingle = s:option( Flag, "RRASingle",
+ translate("Only create average RRAs"), translate("reduces rrd size") )
+rrasingle.default = true
+rrasingle.rmempty = true
+rrasingle.optional = true
+rrasingle:depends( "enable", 1 )
+
+-- 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.rmempty = true
+rratimespans.optional = true
+rratimespans:depends( "enable", 1 )
+
+-- collectd_rrdtool.rrarows (RRARows)
+rrarows = s:option( Value, "RRARows", translate("Rows per RRA") )
+rrarows.isinteger = true
+rrarows.default = 100
+rrarows.rmempty = true
+rrarows.optional = true
+rrarows:depends( "enable", 1 )
+
+-- collectd_rrdtool.xff (XFF)
+xff = s:option( Value, "XFF", translate("RRD XFiles Factor") )
+xff.default = 0.1
+xff.isnumber = true
+xff.rmempty = true
+xff.optional = true
+xff:depends( "enable", 1 )
+
+-- collectd_rrdtool.cachetimeout (CacheTimeout)
+cachetimeout = s:option( Value, "CacheTimeout",
+ translate("Cache collected data for"), translate("Seconds") )
+cachetimeout.isinteger = true
+cachetimeout.default = 100
+cachetimeout.rmempty = true
+cachetimeout.optional = true
+cachetimeout:depends( "enable", 1 )
+
+-- collectd_rrdtool.cacheflush (CacheFlush)
+cacheflush = s:option( Value, "CacheFlush",
+ translate("Flush cache after"), translate("Seconds") )
+cacheflush.isinteger = true
+cacheflush.default = 100
+cacheflush.rmempty = true
+cacheflush.optional = true
+cacheflush:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/splash_leases.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/splash_leases.lua
new file mode 100644
index 0000000000..a15ed0ecce
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/splash_leases.lua
@@ -0,0 +1,24 @@
+--[[
+
+Luci configuration model for statistics - collectd splash_leases plugin configuration
+(c) 2013 Freifunk Augsburg / Michael Wendland <michael@michiwend.com>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+]]--
+
+m = Map("luci_statistics",
+ translate("Splash Leases Plugin Configuration"),
+ translate("The splash leases plugin uses libuci to collect statistics about splash leases."))
+
+s = m:section( NamedSection, "collectd_splash_leases", "luci_statistics" )
+
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 1
+
+return m
+
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/tcpconns.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/tcpconns.lua
new file mode 100644
index 0000000000..9d0f6e137c
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/tcpconns.lua
@@ -0,0 +1,45 @@
+--[[
+
+Luci configuration model for statistics - collectd tcpconns plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("TCPConns Plugin Configuration"),
+ translate(
+ "The tcpconns plugin collects informations about open tcp " ..
+ "connections on selected ports."
+ ))
+
+-- collectd_tcpconns config section
+s = m:section( NamedSection, "collectd_tcpconns", "luci_statistics" )
+
+-- collectd_tcpconns.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_tcpconns.listeningports (ListeningPorts)
+listeningports = s:option( Flag, "ListeningPorts", translate("Monitor all local listen ports") )
+listeningports.default = 1
+listeningports:depends( "enable", 1 )
+
+-- collectd_tcpconns.localports (LocalPort)
+localports = s:option( Value, "LocalPorts", translate("Monitor local ports") )
+localports.optional = true
+localports:depends( "enable", 1 )
+
+-- collectd_tcpconns.remoteports (RemotePort)
+remoteports = s:option( Value, "RemotePorts", translate("Monitor remote ports") )
+remoteports.optional = true
+remoteports:depends( "enable", 1 )
+
+return m
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
new file mode 100644
index 0000000000..cbd52ec1fe
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/unixsock.lua
@@ -0,0 +1,49 @@
+--[[
+
+Luci configuration model for statistics - collectd unixsock plugin configuration
+(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+$Id$
+
+]]--
+
+m = Map("luci_statistics",
+ translate("Unixsock Plugin Configuration"),
+ translate(
+ "The unixsock plugin creates a unix socket which can be used " ..
+ "to read collected data from a running collectd instance."
+ ))
+
+-- collectd_unixsock config section
+s = m:section( NamedSection, "collectd_unixsock", "luci_statistics" )
+
+-- collectd_unixsock.enable
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+-- collectd_unixsock.socketfile (SocketFile)
+socketfile = s:option( Value, "SocketFile" )
+socketfile.default = "/var/run/collect-query.socket"
+socketfile:depends( "enable", 1 )
+
+-- collectd_unixsock.socketgroup (SocketGroup)
+socketgroup = s:option( Value, "SocketGroup" )
+socketgroup.default = "nobody"
+socketgroup.rmempty = true
+socketgroup.optional = true
+socketgroup:depends( "enable", 1 )
+
+-- collectd_unixsock.socketperms (SocketPerms)
+socketperms = s:option( Value, "SocketPerms" )
+socketperms.default = "0770"
+socketperms.rmempty = true
+socketperms.optional = true
+socketperms:depends( "enable", 1 )
+
+return m
diff --git a/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/uptime.lua b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/uptime.lua
new file mode 100644
index 0000000000..3a6c4644e3
--- /dev/null
+++ b/applications/luci-app-statistics/luasrc/model/cbi/luci_statistics/uptime.lua
@@ -0,0 +1,22 @@
+--[[
+
+Copyright 2013 Thomas Endt <tmo26@gmx.de>
+
+Licensed under the Apache License, Version 2.0 (the "License");
+you may not use this file except in compliance with the License.
+You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+]]--
+
+m = Map("luci_statistics",
+ translate("Uptime Plugin Configuration"),
+ translate("The uptime plugin collects statistics about the uptime of the system."))
+
+s = m:section( NamedSection, "collectd_uptime", "luci_statistics" )
+
+enable = s:option( Flag, "enable", translate("Enable this plugin") )
+enable.default = 0
+
+return m
+