From: Jo-Philipp Wich Date: Fri, 23 May 2008 19:23:06 +0000 (+0000) Subject: * ffluci/statistics: port statistics to new controller api, add mysel to NOTICE X-Git-Tag: 0.8.0~1007 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=eaa763cbdb33f292ed13f9b2c2b4b985323f7b5c;p=oweals%2Fluci.git * ffluci/statistics: port statistics to new controller api, add mysel to NOTICE --- diff --git a/NOTICE b/NOTICE index df8a5aebf..dea5e6742 100644 --- a/NOTICE +++ b/NOTICE @@ -2,4 +2,7 @@ FFLuCI - Freifunk Lua Configuration Interface Copyright 2008 Steven Barth Licensed under the Apache License, Version 2.0. --- Contributors: please add your own notice here \ No newline at end of file +-- Contributors: please add your own notice here +Luci-Statistics - Statistics for FFLuCI +Copyright 2008 Jo-Philipp Wich +Licensed under the Apache License, Version 2.0. diff --git a/applications/luci-statistics/src/controller/admin/statistics.lua b/applications/luci-statistics/src/controller/admin/statistics.lua deleted file mode 100644 index 3318f70cd..000000000 --- a/applications/luci-statistics/src/controller/admin/statistics.lua +++ /dev/null @@ -1 +0,0 @@ -module("ffluci.controller.admin.statistics", package.seeall) diff --git a/applications/luci-statistics/src/controller/luci_statistics/luci_statistics.lua b/applications/luci-statistics/src/controller/luci_statistics/luci_statistics.lua new file mode 100644 index 000000000..ad914d80e --- /dev/null +++ b/applications/luci-statistics/src/controller/luci_statistics/luci_statistics.lua @@ -0,0 +1,88 @@ +--[[ + + Luci controller for statistics + Copyright 2008 Jo-Philipp Wich + + $Id$ + +]]-- + +module("ffluci.controller.luci_statistics.luci_statistics", package.seeall) + +fs = require("ffluci.fs") +tpl = require("ffluci.template") + +function _entry( path, ... ) + if fs.isfile( "/usr/lib/collectd/" .. path[4] .. ".so" ) then + entry( path, ... ) + end +end + + +function index() + entry({"admin", "statistics"}, statistics_index, "Statistiken", 80) + entry({"admin", "statistics", "collectd"}, cbi("luci_statistics/collectd"), "Collectd", 10) + + entry({"admin", "statistics", "output"}, statistics_outputplugins, "Ausgabeplugins", 20) + _entry({"admin", "statistics", "output", "rrdtool"}, cbi("luci_statistics/rrdtool"), "RRDTool", 10) + _entry({"admin", "statistics", "output", "network"}, cbi("luci_statistics/network"), "Netzwerk", 20) + _entry({"admin", "statistics", "output", "unixsock"}, cbi("luci_statistics/unixsock"), "Unix Socket", 30) + _entry({"admin", "statistics", "output", "csv"}, cbi("luci_statistics/csv"), "CSV", 40) + + entry({"admin", "statistics", "system"}, statistics_systemplugins, "Systemplugins", 30) + _entry({"admin", "statistics", "system", "exec"}, cbi("luci_statistics/exec"), "Exec", 10) + _entry({"admin", "statistics", "system", "email"}, cbi("luci_statistics/email"), "E-Mail", 20) + _entry({"admin", "statistics", "system", "df"}, cbi("luci_statistics/df"), "Speicherplatz", 30) + _entry({"admin", "statistics", "system", "disk"}, cbi("luci_statistics/disk"), "Datenträger", 40) + _entry({"admin", "statistics", "system", "irq"}, cbi("luci_statistics/irq"), "Interrupts", 50) + _entry({"admin", "statistics", "system", "processes"}, cbi("luci_statistics/processes"), "Prozesse", 60) + + entry({"admin", "statistics", "network"}, statistics_networkplugins, "Netzwerkplugins", 40) + _entry({"admin", "statistics", "network", "interface"}, cbi("luci_statistics/interface"), "Schnittstellen", 10) + _entry({"admin", "statistics", "network", "netlink"}, cbi("luci_statistics/netlink"), "Netlink", 20) + _entry({"admin", "statistics", "network", "iptables"}, cbi("luci_statistics/iptables"), "Firewall", 30) + _entry({"admin", "statistics", "network", "tcpconns"}, cbi("luci_statistics/tcpconns"), "Verbindungen", 40) + _entry({"admin", "statistics", "network", "ping"}, cbi("luci_statistics/ping"), "Ping", 50) + _entry({"admin", "statistics", "network", "dns"}, cbi("luci_statistics/dns"), "DNS", 60) +end + + +function statistics_index() + tpl.render("admin_statistics/index") +end + +function statistics_outputplugins() + plugins = { + rrdtool="RRDTool", + network="Netzwerk", + unixsock="Unix Socket", + csv="CSV" + } + + tpl.render("admin_statistics/outputplugins", {plugins=plugins}) +end + +function statistics_systemplugins() + plugins = { + exec="Exec", + email="E-Mail", + disk="Datenträger", + irq="Interrupts", + processes="Prozesse" + } + + tpl.render("admin_statistics/systemplugins", {plugins=plugins}) +end + +function statistics_networkplugins() + plugins = { + interface="Schnittstellen", + netlink="Netlink", + iptables="Firewall", + tcpconns="Verbindungen", + ping="Ping", + dns="DNS" + } + + tpl.render("admin_statistics/networkplugins", {plugins=plugins}) +end diff --git a/applications/luci-statistics/src/controller/public/statistics.lua b/applications/luci-statistics/src/controller/public/statistics.lua deleted file mode 100644 index d7ed1e327..000000000 --- a/applications/luci-statistics/src/controller/public/statistics.lua +++ /dev/null @@ -1 +0,0 @@ -module("ffluci.controller.public.statistics", package.seeall) diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/csv.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/csv.lua deleted file mode 100644 index e1f2c351d..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/csv.lua +++ /dev/null @@ -1,39 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd csv plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "CSV Plugin", -[[Das CSV-Plugin schreibt in regelmäßigen Abständen die gesammelten Daten als -CSV-Dateien in das angegebene Verzeichnis. Der Speicherbedarf wächst dabei -kontinuierlich!]]) - --- collectd_csv config section -s = m:section( NamedSection, "collectd_csv", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_csv.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_csv.datadir (DataDir) -datadir = s:option( Value, "DataDir", "Ablageverzeichnis für die CSV-Dateien" ) -datadir.default = "127.0.0.1" -datadir:depends( "enable", 1 ) - --- collectd_csv.storerates (StoreRates) -storerates = s:option( Flag, "StoreRates", "Werte nicht absolut, sondern als Raten speichern" ) -storerates.default = 0 -storerates:depends( "enable", 1 ) - -return m - diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/df.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/df.lua deleted file mode 100644 index 6e35afcb3..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/df.lua +++ /dev/null @@ -1,50 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd df plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "DF Plugin", -[[Das DF-Plugin sammelt Informationen über den belegten und verfügbaren Speicherplatz auf den -angegebenen Geräten, Mountpunkten oder Dateisystemtypen.]]) - --- collectd_df config section -s = m:section( NamedSection, "collectd_df", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_df.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_df.devices (Device) -devices = s:option( Value, "Devices", "Gerätedateien", "Einträge mit Leerzeichen trennen" ) -devices.default = "/dev/mtdblock/4" -devices.rmempty = true -devices:depends( "enable", 1 ) - --- collectd_df.mountpoints (MountPoint) -mountpoints = s:option( Value, "MountPoints", "Mountpunkte", "Einträge mit Leerzeichen trennen" ) -mountpoints.default = "/jffs" -mountpoints.rmempty = true -mountpoints:depends( "enable", 1 ) - --- collectd_df.fstypes (FSType) -fstypes = s:option( Value, "FSTypes", "Dateisystemtypen", "Einträge mit Leerzeichen trennen" ) -fstypes.default = "tmpfs" -fstypes.rmempty = true -fstypes:depends( "enable", 1 ) - --- collectd_df.ignoreselected (IgnoreSelected) -ignoreselected = s:option( Flag, "IgnoreSelected", "Logik umkehren und alle Datenträger überwachen die nicht auf die obigen Kriterien zutreffen" ) -ignoreselected.default = 0 -ignoreselected:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/disk.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/disk.lua deleted file mode 100644 index 587091fbd..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/disk.lua +++ /dev/null @@ -1,37 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd disk plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "Disk Plugin", -[[Das Disk-Plugin sammelt Informationen über Augewählte Fesplatten.]]) - --- collectd_disk config section -s = m:section( NamedSection, "collectd_disk", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_disk.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_disk.disks (Disk) -devices = s:option( Value, "Disks", "Fesplatten oder Partitionen", "Einträge mit Leerzeichen trennen" ) -devices.default = "hda1 hdb" -devices.rmempty = true -devices:depends( "enable", 1 ) - --- collectd_disk.ignoreselected (IgnoreSelected) -ignoreselected = s:option( Flag, "IgnoreSelected", "Logik umkehren und alle Datenträger und Partitionen überwachen die nicht auf die obigen Kriterien zutreffen" ) -ignoreselected.default = 0 -ignoreselected:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/dns.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/dns.lua deleted file mode 100644 index ed71a55a3..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/dns.lua +++ /dev/null @@ -1,42 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd dns plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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("ffluci.sys") - - -m = Map("luci_statistics", "DNS Plugin", -[[Das DNS-Plugin nutzt die pcap Bibliothek um DNS-Verkehr zu analysieren.]]) - --- collectd_dns config section -s = m:section( NamedSection, "collectd_dns", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_dns.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_dns.interfaces (Interface) -interfaces = s:option( ListValue, "Interface", "Folgende Schnittstelle überwachen:" ) -interfaces:depends( "enable", 1 ) -interfaces:value("any") -for k, v in pairs(ffluci.sys.net.devices()) do - interfaces:value(v) -end - --- collectd_dns.ignoresources (IgnoreSource) -ignoresources = s:option( Value, "IgnoreSources", "Verkehr von folgenden IP Adressen ignorieren:", "mehrere Einträge mit Leerzeichen trennen" ) -ignoresources.default = "127.0.0.1" -ignoresources:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/email.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/email.lua deleted file mode 100644 index 7b259e829..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/email.lua +++ /dev/null @@ -1,55 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd email plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "E-Mail Plugin", -[[Das E-Mail-Plugin öffnet einen Unix-Socket über welchen E-Mail Statistiken an collectd -übergeben werden können. Dieses Plugin ist primär für die Verwendung mit -Mail::SpamAssassin::Plugin::Collectd gedacht, lässt sich aber auch anderweitig einsetzen.]]) - --- collectd_email config section -s = m:section( NamedSection, "collectd_email", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_email.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_email.socketfile (SocketFile) -socketfile = s:option( Value, "SocketFile", "Pfad für den Unix-Socket" ) -socketfile.default = "/var/run/collect-email.sock" -socketfile:depends( "enable", 1 ) - --- collectd_email.socketgroup (SocketGroup) -socketgroup = s:option( Value, "SocketGroup", "Dateibesitzergruppe für den Unix-Socket ändern" ) -socketgroup.default = "nobody" -socketgroup.rmempty = true -socketgroup.optional = true -socketgroup:depends( "enable", 1 ) - --- collectd_email.socketperms (SocketPerms) -socketperms = s:option( Value, "SocketPerms", "Dateiberechtigungen für den Unix-Socket ändern" ) -socketperms.default = "0770" -socketperms.rmempty = true -socketperms.optional = true -socketperms:depends( "enable", 1 ) - --- collectd_email.maxconns (MaxConns) -maxconns = s:option( Value, "MaxConns", "Maximale Anzahl paralleler Verbindungen", "Werte von 1 bis 16384" ) -maxconns.default = 5 -maxconns.isinteger = true -maxconns.rmempty = true -maxconns.optional = true -maxconns:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/exec.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/exec.lua deleted file mode 100644 index d1fe0f0db..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/exec.lua +++ /dev/null @@ -1,77 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd exec plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "Exec Plugin", -[[Das Exec-Plugin ermöglicht das Ausführen von externen Programmen um Werte einzulesen -oder Aktionen beim Eintreten bestimmter Ereignisse anzustoßen.]]) - --- collectd_exec config section -s = m:section( NamedSection, "collectd_exec", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_exec.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - - --- collectd_exec_input config section (Exec directives) -exec = m:section( TypedSection, "collectd_exec_input", "Befehl zum Einlesen von Daten hinzufügen", -[[Hier können externe Kommandos definiert werden welche durch collectd gestartet werden um bestimmte -Daten zu sammeln. Die Werte werden dabei von der Standardausgabe des Programmes gelesen.]]) -exec.addremove = true -exec.anonymous = true - --- collectd_exec_input.cmdline -exec_cmdline = exec:option( Value, "cmdline", "Kommandozeile" ) -exec_cmdline.default = "/usr/bin/stat-dhcpusers" - --- collectd_exec_input.cmdline -exec_cmduser = exec:option( Value, "cmduser", "Als anderer Benutzer ausführen" ) -exec_cmduser.default = "nobody" -exec_cmduser.rmempty = true -exec_cmduser.optional = true - --- collectd_exec_input.cmdline -exec_cmdgroup = exec:option( Value, "cmdgroup", "Als andere Gruppe ausführen" ) -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", "Befehl zum Ausgeben von Daten hinzufügen", -[[Hier können externe Kommandos definiert werden welche zur Ausführung kommen sobald bestimmte -Ereignise eintreten. Die Daten werden dabei an die Standardeingabe des aufgerufenen Programmes gesendet. -Siehe dazu auch die Sektion "Limits".]]) -notify.addremove = true -notify.anonymous = true - --- collectd_notify_input.cmdline -notify_cmdline = notify:option( Value, "cmdline", "Kommandozeile" ) -notify_cmdline.default = "/usr/bin/stat-dhcpusers" - --- collectd_notify_input.cmdline -notify_cmduser = notify:option( Value, "cmduser", "Als anderer Benutzer ausführen" ) -notify_cmduser.default = "nobody" -notify_cmduser.rmempty = true -notify_cmduser.optional = true - --- collectd_notify_input.cmdline -notify_cmdgroup = notify:option( Value, "cmdgroup", "Als andere Gruppe ausführen" ) -notify_cmdgroup.default = "nogroup" -notify_cmdgroup.rmempty = true -notify_cmdgroup.optional = true - - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/index.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/index.lua deleted file mode 100644 index 21ff457e3..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/index.lua +++ /dev/null @@ -1,71 +0,0 @@ ---[[ - -Luci configuration model for statistics - general collectd configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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("ffluci.sys") - - -m = Map("luci_statistics", "Collector Daemon", -[[Collectd ist ein kleiner und flexibler Dienst zum Sammeln und Abfragen von Daten -aus verschieden Quellen. Zur weiteren Verarbeitung werden die Daten in RRD Datenbanken -gespeichert oder per Multicast Relaying über das Netzwerk versendet.]]) - --- general config section -s = m:section( NamedSection, "general", "luci_statistics", "Allgemeine Einstellungen" ) - --- general.basedir (BaseDir) -basedir = s:option( Value, "BaseDir", "Basisverzeichnis" ) -basedir.default = "/var/run/collectd" - --- general.include (Include) -include = s:option( Value, "Include", "Verzeichnis für Unterkonfigurationen" ) -include.default = "/etc/collectd/conf.d/*.conf" - --- general.pidfile (PIDFile) -pidfile = s:option( Value, "PIDFile", "PID-Datei für den Collector Dienst" ) -pidfile.default = "/var/run/collectd.pid" - --- general.plugindir (PluginDir) -plugindir = s:option( Value, "PluginDir", "Verzeichnis für die Collector-Plugins" ) -plugindir.default = "/usr/lib/collectd/" - --- general.typesdb (TypesDB) -typesdb = s:option( Value, "TypesDB", "Datenbank mit den Datenset-Beschreibungen" ) -typesdb.default = "/etc/collectd/types.db" - --- general.interval (Interval) -interval = s:option( Value, "Interval", "Abfrageintervall für die Datenerfassung", "Sekunden" ) -interval.default = 60 -interval.isnumber = true - --- general.readthreads (ReadThreads) -readthreads = s:option( Value, "ReadThreads", "Anzahl paralleler Prozesse für die Datenabfrage" ) -readthreads.default = 5 -readthreads.isnumber = true - --- general.hostname (Hostname) -hostname = s:option( Value, "Hostname", "Hostname zur Identifikation des Collector Dienstes (leer lassen um den Namen automatisch zu bestimmen)" ) -hostname.default = ffluci.sys.hostname() -hostname.optional = true - --- general.fqdnlookup (FQDNLookup) -fqdnlookup = s:option( Flag, "FQDNLookup", "Versuchen den vollen Hostnamen dieser Installation herauszufinden" ) -fqdnlookup.enabled = "true" -fqdnlookup.disabled = "false" -fqdnlookup.default = "false" -fqdnlookup.optional = true -fqdnlookup:depends( "Hostname", "" ) - - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/interface.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/interface.lua deleted file mode 100644 index 5acd4e93c..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/interface.lua +++ /dev/null @@ -1,42 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd interface plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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("ffluci.sys") - - -m = Map("luci_statistics", "Interface Plugin", -[[Das Interface-Plugin sammelt Informationen zum Netzwerkverkehr auf den einzelnen Schnittstellen.]]) - --- collectd_interface config section -s = m:section( NamedSection, "collectd_interface", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_interface.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_interface.interfaces (Interface) -interfaces = s:option( MultiValue, "Interfaces", "Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" ) -interfaces.widget = "select" -interfaces:depends( "enable", 1 ) -for k, v in pairs(ffluci.sys.net.devices()) do - interfaces:value(v) -end - --- collectd_interface.ignoreselected (IgnoreSelected) -ignoreselected = s:option( Flag, "IgnoreSelected", "Alle Schnittstellen außer ausgewählte überwachen" ) -ignoreselected.default = 0 -ignoreselected:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/iptables.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/iptables.lua deleted file mode 100644 index 475729589..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/iptables.lua +++ /dev/null @@ -1,121 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd iptables plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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("ffluci.sys.iptparser") - -ip = ffluci.sys.iptparser.IptParser() -chains = { } -targets = { } - -for i, rule in ipairs( ip:find() ) do - chains[rule.chain] = true - targets[rule.target] = true -end - - -m = Map("luci_statistics", "Iptables Plugin", -[[Das Iptables-Plugin ermöglicht die Überwachung bestimmter Firewallregeln um -Werte wie die Anzahl der verarbeiteten Pakete oder die insgesamt erfasste Datenmenge -zu speichern.]]) - --- collectd_iptables config section -s = m:section( NamedSection, "collectd_iptables", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_iptables.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - - --- collectd_iptables_match config section (Chain directives) -rule = m:section( TypedSection, "collectd_iptables_match", "Regel hinzufügen", -[[Hier werden die Kriterien festgelegt, nach welchen die Firewall-Regeln zur Überwachung -ausgewählt werden.]]) -rule.addremove = true -rule.anonymous = true - - --- collectd_iptables_match.name -rule_table = rule:option( Value, "name", "Name der Regel", "wird im Diagram verwendet" ) - --- collectd_iptables_match.table -rule_table = rule:option( ListValue, "table", "Firewall-Tabelle" ) -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", "Firewall-Kette (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", "Firewall-Aktion (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", "Netzwerkprotokoll" ) -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", "Quell-IP-Bereich", "Bereich in CIDR Notation" ) -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", "Ziel-IP-Bereich", "Bereich in CIDR Notation" ) -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", "eingehende Schnittstelle", "z.B. eth0.0" ) -rule_inputif.rmempty = true -rule_inputif.optional = true - --- collectd_iptables_match.outputif -rule_outputif = rule:option( Value, "outputif", "ausgehende Schnittstelle", "z.B. eth0.1" ) -rule_outputif.rmempty = true -rule_outputif.optional = true - --- collectd_iptables_match.options -rule_options = rule:option( Value, "options", "Optionen", "z.B. reject-with tcp-reset" ) -rule_options.rmempty = true -rule_options.optional = true - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/irq.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/irq.lua deleted file mode 100644 index 2d15e5232..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/irq.lua +++ /dev/null @@ -1,39 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd irq plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "IRQ Plugin", -[[Das IRQ-Plugin sammelt Informationen zur Auslastung einzelner Interrupts. -Werden keine Interrupts angegeben, überwacht das Plugin alle vorhanden IRQs im System. -]]) - --- collectd_irq config section -s = m:section( NamedSection, "collectd_irq", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_irq.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_irq.irqs (Irq) -irqs = s:option( Value, "Irqs", "Überwachte Interrupts", "mehrere mit Leerzeichen trennen" ) -irqs.optional = true -irqs:depends( "enable", 1 ) - --- collectd_irq.ignoreselected (IgnoreSelected) -ignoreselected = s:option( Flag, "IgnoreSelected", "Alle Interrupts außer ausgewählte überwachen" ) -ignoreselected.default = 0 -ignoreselected.optional = "true" -ignoreselected:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/netlink.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/netlink.lua deleted file mode 100644 index 478560f97..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/netlink.lua +++ /dev/null @@ -1,84 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd netlink plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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("ffluci.sys") - - -m = Map("luci_statistics", "Interface Plugin", -[[Das Netlink-Plugin sammelt erweiterte Informationen wie Qdisc-, Class- und Filter-Werten auf einzelnen Schnittstellen.]]) - --- collectd_netlink config section -s = m:section( NamedSection, "collectd_netlink", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_netlink.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_netlink.interfaces (Interface) -interfaces = s:option( MultiValue, "Interfaces", "einfach Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" ) -interfaces.widget = "select" -interfaces.optional = true -interfaces:depends( "enable", 1 ) -interfaces:value("") -for i, v in ipairs(ffluci.sys.net.devices()) do - interfaces:value(v) -end - --- collectd_netlink.verboseinterfaces (VerboseInterface) -verboseinterfaces = s:option( MultiValue, "VerboseInterfaces", "detailliert Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" ) -verboseinterfaces.widget = "select" -verboseinterfaces.optional = true -verboseinterfaces:depends( "enable", 1 ) -verboseinterfaces:value("") -for i, v in ipairs(ffluci.sys.net.devices()) do - verboseinterfaces:value(v) -end - --- collectd_netlink.qdiscs (QDisc) -qdiscs = s:option( MultiValue, "QDiscs", "Queue Discipline auf Schnittstellen Überwachen", "mehrere Einträge mit Strg selektieren" ) -qdiscs.widget = "select" -qdiscs.optional = true -qdiscs:depends( "enable", 1 ) -qdiscs:value("") -for i, v in ipairs(ffluci.sys.net.devices()) do - qdiscs:value(v) -end - --- collectd_netlink.classes (Class) -classs = s:option( MultiValue, "Classes", "Shapingklassen auf Schnittstellen Überwachen", "mehrere Einträge mit Strg selektieren" ) -classs.widget = "select" -classs.optional = true -classs:depends( "enable", 1 ) -classs:value("") -for i, v in ipairs(ffluci.sys.net.devices()) do - classs:value(v) -end - --- collectd_netlink.filters (Filter) -filters = s:option( MultiValue, "Filters", "Filterklassen auf Schnittstellen Überwachen", "mehrere Einträge mit Strg selektieren" ) -filters.widget = "select" -filters.optional = true -filters:depends( "enable", 1 ) -filters:value("") -for i, v in ipairs(ffluci.sys.net.devices()) do - filters:value(v) -end - --- collectd_netlink.ignoreselected (IgnoreSelected) -ignoreselected = s:option( Flag, "IgnoreSelected", "Alle Schnittstellen außer ausgewählte überwachen" ) -ignoreselected.default = 0 -ignoreselected:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/network.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/network.lua deleted file mode 100644 index ab3c6303c..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/network.lua +++ /dev/null @@ -1,84 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd network plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "Network Plugin", -[[Das Network-Plugin ermöglicht den netzwerkgestützen Austausch von Statistikdaten.]]) - --- collectd_network config section -s = m:section( NamedSection, "collectd_network", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_network.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - - --- collectd_network_listen config section (Listen) -listen = m:section( TypedSection, "collectd_network_listen", "Schnittstellen für eingehende Verbindungen", -[[Legt fest auf welchen Schnittstellen bzw. IP-Adressen collectd auf eingehende Verbindungen wartet.]]) -listen.addremove = true -listen.anonymous = true - - --- collectd_network_listen.host -listen_host = listen:option( Value, "host", "Listen-Host", "Host-, IP- oder IPv6-Adresse" ) -listen_host.default = "0.0.0.0" - --- collectd_network_listen.port -listen_port = listen:option( Value, "port", "Listen-Port", "Partnummer 0 - 65535" ) -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", "Schnittstellen für ausgehende Verbindungen", -[[Legt fest auf welchen Schnittstellen bzw. IP-Adressen collectd als Server agiert.]]) -server.addremove = true -server.anonymous = true - - --- collectd_network_server.host -server_host = server:option( Value, "host", "Server-Host", "Host-, IP- oder IPv6-Adresse" ) -server_host.default = "0.0.0.0" - --- collectd_network_server.port -server_port = server:option( Value, "port", "Server-Port", "Partnummer 0 - 65535" ) -server_port.default = 25826 -server_port.isinteger = true -server_port.optional = true - --- collectd_network.timetolive (TimeToLive) -ttl = s:option( Value, "TimeToLive", "Time-to-Live für die Pakete", "Werte 0 bis 255" ) -ttl.default = 128 -ttl.isinteger = true -ttl.optional = true -ttl:depends( "enable", 1 ) - --- collectd_network.forward (Forward) -forward = s:option( Flag, "Forward", "Weiterleitung zwischen verschiedenen Listen- und Server-Adressen" ) -forward.default = 0 -forward.optional = true -forward:depends( "enable", 1 ) - --- collectd_network.forward (CacheFlush) -forward = s:option( Value, "CacheFlush", "Löschintervall für temporäre Daten", "in Sekunden" ) -forward.default = 86400 -forward.isinteger = true -forward.optional = true -forward:depends( "enable", 1 ) - - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/ping.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/ping.lua deleted file mode 100644 index 334a0300d..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/ping.lua +++ /dev/null @@ -1,38 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd ping plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "Ping Plugin", -[[Das Ping-Plugin veranlasst periodische ICMP-Requests an die angegebenen Adressen und zeichnet -Parameter wie Verfügbarkeit und Antwortzeiten auf.]]) - --- collectd_ping config section -s = m:section( NamedSection, "collectd_ping", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_ping.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_ping.hosts (Host) -hosts = s:option( Value, "Hosts", "Zieladressen", "Einträge durch Leerzeichen trennen" ) -hosts.default = "127.0.0.1" -hosts:depends( "enable", 1 ) - --- collectd_ping.ttl (TTL) -ttl = s:option( Value, "TTL", "Time-to-Live für die ICMP-Pakete (Werte 0 bis 255)" ) -ttl.isinteger = true -ttl.default = 128 -ttl:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/processes.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/processes.lua deleted file mode 100644 index 354cecaf1..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/processes.lua +++ /dev/null @@ -1,31 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd processes plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "Processes Plugin", -[[Das Processes-Plugin sammelt Informationen über ausgewählte Prozesse auf diesem Gerät.]]) - --- collectd_processes config section -s = m:section( NamedSection, "collectd_processes", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_processes.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_processes.processes (Process) -processes = s:option( Value, "Processes", "Überwachte Prozesse", "mehrere mit Leerzeichen trennen" ) -processes.default = "olsrd bmxd httpd dnsmasq dropbear tinc" -processes:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/rrdtool.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/rrdtool.lua deleted file mode 100644 index 89adf52a7..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/rrdtool.lua +++ /dev/null @@ -1,99 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd rrdtool plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "RRDTool Plugin", -[[Das RRDTool-Plugin schreibt die gesammelten Werte in sogenannte RRD Datenbanken, welche die -Grundlage für die Statistik-Diagramme bilden.

-Die Einstellungen auf dieser Seite sollten nur in Ausnahmefällen geändert werden, -falsche Einstellungen führen zu einem sehr hohem Platzverbrauch im Temp-Verzeichnis und das -Gerät kann nur noch im Failsafe-Modus repariert werden!]]) - --- collectd_rrdtool config section -s = m:section( NamedSection, "collectd_rrdtool", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_rrdtool.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 1 - --- collectd_rrdtool.datadir (DataDir) -datadir = s:option( Value, "DataDir", "Speicherort für die RRD Datenbanken" ) -datadir.default = "/tmp" -datadir.rmempty = true -datadir.optional = true -datadir:depends( "enable", 1 ) - --- collectd_rrdtool.stepsize (StepSize) -stepsize = s:option( Value, "StepSize", "Schritt-Interval", "in Sekunden" ) -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", "Heart-Beat-Interval", "in Sekunden" ) -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", 'Jeweils nur ein RRA anlegen', "reduziert die Größe der RRDs" ) -rrasingle.default = true -rrasingle.rmempty = true -rrasingle.optional = true -rrasingle:depends( "enable", 1 ) - --- collectd_rrdtool.rratimespans (RRATimespan) -rratimespans = s:option( Value, "RRATimespans", "Gespeicherte Zeitspannen", "in Sekunden; mehrere mit Leerzeichen trennen" ) -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", "Anzahl der Datenpunkte pro Zeitspanne" ) -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", "RRD XFiles Faktor" ) -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", "Daten für Zeitspanne cachen", "in Sekunden" ) -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", "Cache nach Zeitspanne leeren", "in Sekunden" ) -cacheflush.isinteger = true -cacheflush.default = 100 -cacheflush.rmempty = true -cacheflush.optional = true -cacheflush:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/tcpconns.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/tcpconns.lua deleted file mode 100644 index 079befac5..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/tcpconns.lua +++ /dev/null @@ -1,41 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd tcpconns plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "Tcpconns Plugin", -[[Das Tcpconns-Plugin zählt TCP-Verbindungen auf einzelnen Ports.]]) - --- collectd_tcpconns config section -s = m:section( NamedSection, "collectd_tcpconns", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_tcpconns.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_tcpconns.listeningports (ListeningPorts) -listeningports = s:option( Flag, "ListeningPorts", "Alle von lokalen Diensten genutzen Ports überwachen" ) -listeningports.default = 1 -listeningports:depends( "enable", 1 ) - --- collectd_tcpconns.localports (LocalPort) -localports = s:option( Value, "LocalPorts", "Lokale Ports", "mit Leerzeichen trennen" ) -localports.optional = true -localports:depends( "enable", 1 ) - --- collectd_tcpconns.remoteports (RemotePort) -remoteports = s:option( Value, "RemotePorts", "Entfernte Ports", "mit Leerzeichen trennen" ) -remoteports.optional = true -remoteports:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/unixsock.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/unixsock.lua deleted file mode 100644 index dcedd381b..000000000 --- a/applications/luci-statistics/src/model/cbi/admin_statistics/unixsock.lua +++ /dev/null @@ -1,46 +0,0 @@ ---[[ - -Luci configuration model for statistics - collectd unixsock plugin configuration -(c) 2008 Freifunk Leipzig / Jo-Philipp Wich - -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", "Unixsock Plugin", -[[Das Unixsock-Plugin öffnet einen Socket über welchen die gesammelten Werte des -laufenden collectd Prozesses abgefragt werden können.]]) - --- collectd_unixsock config section -s = m:section( NamedSection, "collectd_unixsock", "luci_statistics", "Pluginkonfiguration" ) - --- collectd_unixsock.enable -enable = s:option( Flag, "enable", "Plugin aktivieren" ) -enable.default = 0 - --- collectd_unixsock.socketfile (SocketFile) -socketfile = s:option( Value, "SocketFile", "Pfad für den Unix-Socket" ) -socketfile.default = "/var/run/collect-query.socket" -socketfile:depends( "enable", 1 ) - --- collectd_unixsock.socketgroup (SocketGroup) -socketgroup = s:option( Value, "SocketGroup", "Dateibesitzergruppe für den Unix-Socket ändern" ) -socketgroup.default = "nobody" -socketgroup.rmempty = true -socketgroup.optional = true -socketgroup:depends( "enable", 1 ) - --- collectd_unixsock.socketperms (SocketPerms) -socketperms = s:option( Value, "SocketPerms", "Dateiberechtigungen für den Unix-Socket ändern" ) -socketperms.default = "0770" -socketperms.rmempty = true -socketperms.optional = true -socketperms:depends( "enable", 1 ) - -return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/collectd.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/collectd.lua new file mode 100644 index 000000000..21ff457e3 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/collectd.lua @@ -0,0 +1,71 @@ +--[[ + +Luci configuration model for statistics - general collectd configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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("ffluci.sys") + + +m = Map("luci_statistics", "Collector Daemon", +[[Collectd ist ein kleiner und flexibler Dienst zum Sammeln und Abfragen von Daten +aus verschieden Quellen. Zur weiteren Verarbeitung werden die Daten in RRD Datenbanken +gespeichert oder per Multicast Relaying über das Netzwerk versendet.]]) + +-- general config section +s = m:section( NamedSection, "general", "luci_statistics", "Allgemeine Einstellungen" ) + +-- general.basedir (BaseDir) +basedir = s:option( Value, "BaseDir", "Basisverzeichnis" ) +basedir.default = "/var/run/collectd" + +-- general.include (Include) +include = s:option( Value, "Include", "Verzeichnis für Unterkonfigurationen" ) +include.default = "/etc/collectd/conf.d/*.conf" + +-- general.pidfile (PIDFile) +pidfile = s:option( Value, "PIDFile", "PID-Datei für den Collector Dienst" ) +pidfile.default = "/var/run/collectd.pid" + +-- general.plugindir (PluginDir) +plugindir = s:option( Value, "PluginDir", "Verzeichnis für die Collector-Plugins" ) +plugindir.default = "/usr/lib/collectd/" + +-- general.typesdb (TypesDB) +typesdb = s:option( Value, "TypesDB", "Datenbank mit den Datenset-Beschreibungen" ) +typesdb.default = "/etc/collectd/types.db" + +-- general.interval (Interval) +interval = s:option( Value, "Interval", "Abfrageintervall für die Datenerfassung", "Sekunden" ) +interval.default = 60 +interval.isnumber = true + +-- general.readthreads (ReadThreads) +readthreads = s:option( Value, "ReadThreads", "Anzahl paralleler Prozesse für die Datenabfrage" ) +readthreads.default = 5 +readthreads.isnumber = true + +-- general.hostname (Hostname) +hostname = s:option( Value, "Hostname", "Hostname zur Identifikation des Collector Dienstes (leer lassen um den Namen automatisch zu bestimmen)" ) +hostname.default = ffluci.sys.hostname() +hostname.optional = true + +-- general.fqdnlookup (FQDNLookup) +fqdnlookup = s:option( Flag, "FQDNLookup", "Versuchen den vollen Hostnamen dieser Installation herauszufinden" ) +fqdnlookup.enabled = "true" +fqdnlookup.disabled = "false" +fqdnlookup.default = "false" +fqdnlookup.optional = true +fqdnlookup:depends( "Hostname", "" ) + + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/csv.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/csv.lua new file mode 100644 index 000000000..e1f2c351d --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/csv.lua @@ -0,0 +1,39 @@ +--[[ + +Luci configuration model for statistics - collectd csv plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "CSV Plugin", +[[Das CSV-Plugin schreibt in regelmäßigen Abständen die gesammelten Daten als +CSV-Dateien in das angegebene Verzeichnis. Der Speicherbedarf wächst dabei +kontinuierlich!]]) + +-- collectd_csv config section +s = m:section( NamedSection, "collectd_csv", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_csv.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_csv.datadir (DataDir) +datadir = s:option( Value, "DataDir", "Ablageverzeichnis für die CSV-Dateien" ) +datadir.default = "127.0.0.1" +datadir:depends( "enable", 1 ) + +-- collectd_csv.storerates (StoreRates) +storerates = s:option( Flag, "StoreRates", "Werte nicht absolut, sondern als Raten speichern" ) +storerates.default = 0 +storerates:depends( "enable", 1 ) + +return m + diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/df.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/df.lua new file mode 100644 index 000000000..6e35afcb3 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/df.lua @@ -0,0 +1,50 @@ +--[[ + +Luci configuration model for statistics - collectd df plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "DF Plugin", +[[Das DF-Plugin sammelt Informationen über den belegten und verfügbaren Speicherplatz auf den +angegebenen Geräten, Mountpunkten oder Dateisystemtypen.]]) + +-- collectd_df config section +s = m:section( NamedSection, "collectd_df", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_df.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_df.devices (Device) +devices = s:option( Value, "Devices", "Gerätedateien", "Einträge mit Leerzeichen trennen" ) +devices.default = "/dev/mtdblock/4" +devices.rmempty = true +devices:depends( "enable", 1 ) + +-- collectd_df.mountpoints (MountPoint) +mountpoints = s:option( Value, "MountPoints", "Mountpunkte", "Einträge mit Leerzeichen trennen" ) +mountpoints.default = "/jffs" +mountpoints.rmempty = true +mountpoints:depends( "enable", 1 ) + +-- collectd_df.fstypes (FSType) +fstypes = s:option( Value, "FSTypes", "Dateisystemtypen", "Einträge mit Leerzeichen trennen" ) +fstypes.default = "tmpfs" +fstypes.rmempty = true +fstypes:depends( "enable", 1 ) + +-- collectd_df.ignoreselected (IgnoreSelected) +ignoreselected = s:option( Flag, "IgnoreSelected", "Logik umkehren und alle Datenträger überwachen die nicht auf die obigen Kriterien zutreffen" ) +ignoreselected.default = 0 +ignoreselected:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/disk.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/disk.lua new file mode 100644 index 000000000..587091fbd --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/disk.lua @@ -0,0 +1,37 @@ +--[[ + +Luci configuration model for statistics - collectd disk plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "Disk Plugin", +[[Das Disk-Plugin sammelt Informationen über Augewählte Fesplatten.]]) + +-- collectd_disk config section +s = m:section( NamedSection, "collectd_disk", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_disk.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_disk.disks (Disk) +devices = s:option( Value, "Disks", "Fesplatten oder Partitionen", "Einträge mit Leerzeichen trennen" ) +devices.default = "hda1 hdb" +devices.rmempty = true +devices:depends( "enable", 1 ) + +-- collectd_disk.ignoreselected (IgnoreSelected) +ignoreselected = s:option( Flag, "IgnoreSelected", "Logik umkehren und alle Datenträger und Partitionen überwachen die nicht auf die obigen Kriterien zutreffen" ) +ignoreselected.default = 0 +ignoreselected:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/dns.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/dns.lua new file mode 100644 index 000000000..ed71a55a3 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/dns.lua @@ -0,0 +1,42 @@ +--[[ + +Luci configuration model for statistics - collectd dns plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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("ffluci.sys") + + +m = Map("luci_statistics", "DNS Plugin", +[[Das DNS-Plugin nutzt die pcap Bibliothek um DNS-Verkehr zu analysieren.]]) + +-- collectd_dns config section +s = m:section( NamedSection, "collectd_dns", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_dns.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_dns.interfaces (Interface) +interfaces = s:option( ListValue, "Interface", "Folgende Schnittstelle überwachen:" ) +interfaces:depends( "enable", 1 ) +interfaces:value("any") +for k, v in pairs(ffluci.sys.net.devices()) do + interfaces:value(v) +end + +-- collectd_dns.ignoresources (IgnoreSource) +ignoresources = s:option( Value, "IgnoreSources", "Verkehr von folgenden IP Adressen ignorieren:", "mehrere Einträge mit Leerzeichen trennen" ) +ignoresources.default = "127.0.0.1" +ignoresources:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/email.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/email.lua new file mode 100644 index 000000000..7b259e829 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/email.lua @@ -0,0 +1,55 @@ +--[[ + +Luci configuration model for statistics - collectd email plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "E-Mail Plugin", +[[Das E-Mail-Plugin öffnet einen Unix-Socket über welchen E-Mail Statistiken an collectd +übergeben werden können. Dieses Plugin ist primär für die Verwendung mit +Mail::SpamAssassin::Plugin::Collectd gedacht, lässt sich aber auch anderweitig einsetzen.]]) + +-- collectd_email config section +s = m:section( NamedSection, "collectd_email", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_email.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_email.socketfile (SocketFile) +socketfile = s:option( Value, "SocketFile", "Pfad für den Unix-Socket" ) +socketfile.default = "/var/run/collect-email.sock" +socketfile:depends( "enable", 1 ) + +-- collectd_email.socketgroup (SocketGroup) +socketgroup = s:option( Value, "SocketGroup", "Dateibesitzergruppe für den Unix-Socket ändern" ) +socketgroup.default = "nobody" +socketgroup.rmempty = true +socketgroup.optional = true +socketgroup:depends( "enable", 1 ) + +-- collectd_email.socketperms (SocketPerms) +socketperms = s:option( Value, "SocketPerms", "Dateiberechtigungen für den Unix-Socket ändern" ) +socketperms.default = "0770" +socketperms.rmempty = true +socketperms.optional = true +socketperms:depends( "enable", 1 ) + +-- collectd_email.maxconns (MaxConns) +maxconns = s:option( Value, "MaxConns", "Maximale Anzahl paralleler Verbindungen", "Werte von 1 bis 16384" ) +maxconns.default = 5 +maxconns.isinteger = true +maxconns.rmempty = true +maxconns.optional = true +maxconns:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/exec.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/exec.lua new file mode 100644 index 000000000..d1fe0f0db --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/exec.lua @@ -0,0 +1,77 @@ +--[[ + +Luci configuration model for statistics - collectd exec plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "Exec Plugin", +[[Das Exec-Plugin ermöglicht das Ausführen von externen Programmen um Werte einzulesen +oder Aktionen beim Eintreten bestimmter Ereignisse anzustoßen.]]) + +-- collectd_exec config section +s = m:section( NamedSection, "collectd_exec", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_exec.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + + +-- collectd_exec_input config section (Exec directives) +exec = m:section( TypedSection, "collectd_exec_input", "Befehl zum Einlesen von Daten hinzufügen", +[[Hier können externe Kommandos definiert werden welche durch collectd gestartet werden um bestimmte +Daten zu sammeln. Die Werte werden dabei von der Standardausgabe des Programmes gelesen.]]) +exec.addremove = true +exec.anonymous = true + +-- collectd_exec_input.cmdline +exec_cmdline = exec:option( Value, "cmdline", "Kommandozeile" ) +exec_cmdline.default = "/usr/bin/stat-dhcpusers" + +-- collectd_exec_input.cmdline +exec_cmduser = exec:option( Value, "cmduser", "Als anderer Benutzer ausführen" ) +exec_cmduser.default = "nobody" +exec_cmduser.rmempty = true +exec_cmduser.optional = true + +-- collectd_exec_input.cmdline +exec_cmdgroup = exec:option( Value, "cmdgroup", "Als andere Gruppe ausführen" ) +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", "Befehl zum Ausgeben von Daten hinzufügen", +[[Hier können externe Kommandos definiert werden welche zur Ausführung kommen sobald bestimmte +Ereignise eintreten. Die Daten werden dabei an die Standardeingabe des aufgerufenen Programmes gesendet. +Siehe dazu auch die Sektion "Limits".]]) +notify.addremove = true +notify.anonymous = true + +-- collectd_notify_input.cmdline +notify_cmdline = notify:option( Value, "cmdline", "Kommandozeile" ) +notify_cmdline.default = "/usr/bin/stat-dhcpusers" + +-- collectd_notify_input.cmdline +notify_cmduser = notify:option( Value, "cmduser", "Als anderer Benutzer ausführen" ) +notify_cmduser.default = "nobody" +notify_cmduser.rmempty = true +notify_cmduser.optional = true + +-- collectd_notify_input.cmdline +notify_cmdgroup = notify:option( Value, "cmdgroup", "Als andere Gruppe ausführen" ) +notify_cmdgroup.default = "nogroup" +notify_cmdgroup.rmempty = true +notify_cmdgroup.optional = true + + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/interface.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/interface.lua new file mode 100644 index 000000000..5acd4e93c --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/interface.lua @@ -0,0 +1,42 @@ +--[[ + +Luci configuration model for statistics - collectd interface plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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("ffluci.sys") + + +m = Map("luci_statistics", "Interface Plugin", +[[Das Interface-Plugin sammelt Informationen zum Netzwerkverkehr auf den einzelnen Schnittstellen.]]) + +-- collectd_interface config section +s = m:section( NamedSection, "collectd_interface", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_interface.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_interface.interfaces (Interface) +interfaces = s:option( MultiValue, "Interfaces", "Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" ) +interfaces.widget = "select" +interfaces:depends( "enable", 1 ) +for k, v in pairs(ffluci.sys.net.devices()) do + interfaces:value(v) +end + +-- collectd_interface.ignoreselected (IgnoreSelected) +ignoreselected = s:option( Flag, "IgnoreSelected", "Alle Schnittstellen außer ausgewählte überwachen" ) +ignoreselected.default = 0 +ignoreselected:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/iptables.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/iptables.lua new file mode 100644 index 000000000..475729589 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/iptables.lua @@ -0,0 +1,121 @@ +--[[ + +Luci configuration model for statistics - collectd iptables plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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("ffluci.sys.iptparser") + +ip = ffluci.sys.iptparser.IptParser() +chains = { } +targets = { } + +for i, rule in ipairs( ip:find() ) do + chains[rule.chain] = true + targets[rule.target] = true +end + + +m = Map("luci_statistics", "Iptables Plugin", +[[Das Iptables-Plugin ermöglicht die Überwachung bestimmter Firewallregeln um +Werte wie die Anzahl der verarbeiteten Pakete oder die insgesamt erfasste Datenmenge +zu speichern.]]) + +-- collectd_iptables config section +s = m:section( NamedSection, "collectd_iptables", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_iptables.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + + +-- collectd_iptables_match config section (Chain directives) +rule = m:section( TypedSection, "collectd_iptables_match", "Regel hinzufügen", +[[Hier werden die Kriterien festgelegt, nach welchen die Firewall-Regeln zur Überwachung +ausgewählt werden.]]) +rule.addremove = true +rule.anonymous = true + + +-- collectd_iptables_match.name +rule_table = rule:option( Value, "name", "Name der Regel", "wird im Diagram verwendet" ) + +-- collectd_iptables_match.table +rule_table = rule:option( ListValue, "table", "Firewall-Tabelle" ) +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", "Firewall-Kette (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", "Firewall-Aktion (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", "Netzwerkprotokoll" ) +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", "Quell-IP-Bereich", "Bereich in CIDR Notation" ) +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", "Ziel-IP-Bereich", "Bereich in CIDR Notation" ) +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", "eingehende Schnittstelle", "z.B. eth0.0" ) +rule_inputif.rmempty = true +rule_inputif.optional = true + +-- collectd_iptables_match.outputif +rule_outputif = rule:option( Value, "outputif", "ausgehende Schnittstelle", "z.B. eth0.1" ) +rule_outputif.rmempty = true +rule_outputif.optional = true + +-- collectd_iptables_match.options +rule_options = rule:option( Value, "options", "Optionen", "z.B. reject-with tcp-reset" ) +rule_options.rmempty = true +rule_options.optional = true + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/irq.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/irq.lua new file mode 100644 index 000000000..2d15e5232 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/irq.lua @@ -0,0 +1,39 @@ +--[[ + +Luci configuration model for statistics - collectd irq plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "IRQ Plugin", +[[Das IRQ-Plugin sammelt Informationen zur Auslastung einzelner Interrupts. +Werden keine Interrupts angegeben, überwacht das Plugin alle vorhanden IRQs im System. +]]) + +-- collectd_irq config section +s = m:section( NamedSection, "collectd_irq", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_irq.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_irq.irqs (Irq) +irqs = s:option( Value, "Irqs", "Überwachte Interrupts", "mehrere mit Leerzeichen trennen" ) +irqs.optional = true +irqs:depends( "enable", 1 ) + +-- collectd_irq.ignoreselected (IgnoreSelected) +ignoreselected = s:option( Flag, "IgnoreSelected", "Alle Interrupts außer ausgewählte überwachen" ) +ignoreselected.default = 0 +ignoreselected.optional = "true" +ignoreselected:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/netlink.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/netlink.lua new file mode 100644 index 000000000..478560f97 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/netlink.lua @@ -0,0 +1,84 @@ +--[[ + +Luci configuration model for statistics - collectd netlink plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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("ffluci.sys") + + +m = Map("luci_statistics", "Interface Plugin", +[[Das Netlink-Plugin sammelt erweiterte Informationen wie Qdisc-, Class- und Filter-Werten auf einzelnen Schnittstellen.]]) + +-- collectd_netlink config section +s = m:section( NamedSection, "collectd_netlink", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_netlink.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_netlink.interfaces (Interface) +interfaces = s:option( MultiValue, "Interfaces", "einfach Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" ) +interfaces.widget = "select" +interfaces.optional = true +interfaces:depends( "enable", 1 ) +interfaces:value("") +for i, v in ipairs(ffluci.sys.net.devices()) do + interfaces:value(v) +end + +-- collectd_netlink.verboseinterfaces (VerboseInterface) +verboseinterfaces = s:option( MultiValue, "VerboseInterfaces", "detailliert Überwachte Schnittstellen", "mehrere Einträge mit Strg selektieren" ) +verboseinterfaces.widget = "select" +verboseinterfaces.optional = true +verboseinterfaces:depends( "enable", 1 ) +verboseinterfaces:value("") +for i, v in ipairs(ffluci.sys.net.devices()) do + verboseinterfaces:value(v) +end + +-- collectd_netlink.qdiscs (QDisc) +qdiscs = s:option( MultiValue, "QDiscs", "Queue Discipline auf Schnittstellen Überwachen", "mehrere Einträge mit Strg selektieren" ) +qdiscs.widget = "select" +qdiscs.optional = true +qdiscs:depends( "enable", 1 ) +qdiscs:value("") +for i, v in ipairs(ffluci.sys.net.devices()) do + qdiscs:value(v) +end + +-- collectd_netlink.classes (Class) +classs = s:option( MultiValue, "Classes", "Shapingklassen auf Schnittstellen Überwachen", "mehrere Einträge mit Strg selektieren" ) +classs.widget = "select" +classs.optional = true +classs:depends( "enable", 1 ) +classs:value("") +for i, v in ipairs(ffluci.sys.net.devices()) do + classs:value(v) +end + +-- collectd_netlink.filters (Filter) +filters = s:option( MultiValue, "Filters", "Filterklassen auf Schnittstellen Überwachen", "mehrere Einträge mit Strg selektieren" ) +filters.widget = "select" +filters.optional = true +filters:depends( "enable", 1 ) +filters:value("") +for i, v in ipairs(ffluci.sys.net.devices()) do + filters:value(v) +end + +-- collectd_netlink.ignoreselected (IgnoreSelected) +ignoreselected = s:option( Flag, "IgnoreSelected", "Alle Schnittstellen außer ausgewählte überwachen" ) +ignoreselected.default = 0 +ignoreselected:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/network.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/network.lua new file mode 100644 index 000000000..ab3c6303c --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/network.lua @@ -0,0 +1,84 @@ +--[[ + +Luci configuration model for statistics - collectd network plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "Network Plugin", +[[Das Network-Plugin ermöglicht den netzwerkgestützen Austausch von Statistikdaten.]]) + +-- collectd_network config section +s = m:section( NamedSection, "collectd_network", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_network.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + + +-- collectd_network_listen config section (Listen) +listen = m:section( TypedSection, "collectd_network_listen", "Schnittstellen für eingehende Verbindungen", +[[Legt fest auf welchen Schnittstellen bzw. IP-Adressen collectd auf eingehende Verbindungen wartet.]]) +listen.addremove = true +listen.anonymous = true + + +-- collectd_network_listen.host +listen_host = listen:option( Value, "host", "Listen-Host", "Host-, IP- oder IPv6-Adresse" ) +listen_host.default = "0.0.0.0" + +-- collectd_network_listen.port +listen_port = listen:option( Value, "port", "Listen-Port", "Partnummer 0 - 65535" ) +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", "Schnittstellen für ausgehende Verbindungen", +[[Legt fest auf welchen Schnittstellen bzw. IP-Adressen collectd als Server agiert.]]) +server.addremove = true +server.anonymous = true + + +-- collectd_network_server.host +server_host = server:option( Value, "host", "Server-Host", "Host-, IP- oder IPv6-Adresse" ) +server_host.default = "0.0.0.0" + +-- collectd_network_server.port +server_port = server:option( Value, "port", "Server-Port", "Partnummer 0 - 65535" ) +server_port.default = 25826 +server_port.isinteger = true +server_port.optional = true + +-- collectd_network.timetolive (TimeToLive) +ttl = s:option( Value, "TimeToLive", "Time-to-Live für die Pakete", "Werte 0 bis 255" ) +ttl.default = 128 +ttl.isinteger = true +ttl.optional = true +ttl:depends( "enable", 1 ) + +-- collectd_network.forward (Forward) +forward = s:option( Flag, "Forward", "Weiterleitung zwischen verschiedenen Listen- und Server-Adressen" ) +forward.default = 0 +forward.optional = true +forward:depends( "enable", 1 ) + +-- collectd_network.forward (CacheFlush) +forward = s:option( Value, "CacheFlush", "Löschintervall für temporäre Daten", "in Sekunden" ) +forward.default = 86400 +forward.isinteger = true +forward.optional = true +forward:depends( "enable", 1 ) + + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/ping.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/ping.lua new file mode 100644 index 000000000..334a0300d --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/ping.lua @@ -0,0 +1,38 @@ +--[[ + +Luci configuration model for statistics - collectd ping plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "Ping Plugin", +[[Das Ping-Plugin veranlasst periodische ICMP-Requests an die angegebenen Adressen und zeichnet +Parameter wie Verfügbarkeit und Antwortzeiten auf.]]) + +-- collectd_ping config section +s = m:section( NamedSection, "collectd_ping", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_ping.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_ping.hosts (Host) +hosts = s:option( Value, "Hosts", "Zieladressen", "Einträge durch Leerzeichen trennen" ) +hosts.default = "127.0.0.1" +hosts:depends( "enable", 1 ) + +-- collectd_ping.ttl (TTL) +ttl = s:option( Value, "TTL", "Time-to-Live für die ICMP-Pakete (Werte 0 bis 255)" ) +ttl.isinteger = true +ttl.default = 128 +ttl:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/processes.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/processes.lua new file mode 100644 index 000000000..354cecaf1 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/processes.lua @@ -0,0 +1,31 @@ +--[[ + +Luci configuration model for statistics - collectd processes plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "Processes Plugin", +[[Das Processes-Plugin sammelt Informationen über ausgewählte Prozesse auf diesem Gerät.]]) + +-- collectd_processes config section +s = m:section( NamedSection, "collectd_processes", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_processes.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_processes.processes (Process) +processes = s:option( Value, "Processes", "Überwachte Prozesse", "mehrere mit Leerzeichen trennen" ) +processes.default = "olsrd bmxd httpd dnsmasq dropbear tinc" +processes:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/rrdtool.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/rrdtool.lua new file mode 100644 index 000000000..89adf52a7 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/rrdtool.lua @@ -0,0 +1,99 @@ +--[[ + +Luci configuration model for statistics - collectd rrdtool plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "RRDTool Plugin", +[[Das RRDTool-Plugin schreibt die gesammelten Werte in sogenannte RRD Datenbanken, welche die +Grundlage für die Statistik-Diagramme bilden.

+Die Einstellungen auf dieser Seite sollten nur in Ausnahmefällen geändert werden, +falsche Einstellungen führen zu einem sehr hohem Platzverbrauch im Temp-Verzeichnis und das +Gerät kann nur noch im Failsafe-Modus repariert werden!]]) + +-- collectd_rrdtool config section +s = m:section( NamedSection, "collectd_rrdtool", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_rrdtool.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 1 + +-- collectd_rrdtool.datadir (DataDir) +datadir = s:option( Value, "DataDir", "Speicherort für die RRD Datenbanken" ) +datadir.default = "/tmp" +datadir.rmempty = true +datadir.optional = true +datadir:depends( "enable", 1 ) + +-- collectd_rrdtool.stepsize (StepSize) +stepsize = s:option( Value, "StepSize", "Schritt-Interval", "in Sekunden" ) +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", "Heart-Beat-Interval", "in Sekunden" ) +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", 'Jeweils nur ein RRA anlegen', "reduziert die Größe der RRDs" ) +rrasingle.default = true +rrasingle.rmempty = true +rrasingle.optional = true +rrasingle:depends( "enable", 1 ) + +-- collectd_rrdtool.rratimespans (RRATimespan) +rratimespans = s:option( Value, "RRATimespans", "Gespeicherte Zeitspannen", "in Sekunden; mehrere mit Leerzeichen trennen" ) +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", "Anzahl der Datenpunkte pro Zeitspanne" ) +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", "RRD XFiles Faktor" ) +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", "Daten für Zeitspanne cachen", "in Sekunden" ) +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", "Cache nach Zeitspanne leeren", "in Sekunden" ) +cacheflush.isinteger = true +cacheflush.default = 100 +cacheflush.rmempty = true +cacheflush.optional = true +cacheflush:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/tcpconns.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/tcpconns.lua new file mode 100644 index 000000000..079befac5 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/tcpconns.lua @@ -0,0 +1,41 @@ +--[[ + +Luci configuration model for statistics - collectd tcpconns plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "Tcpconns Plugin", +[[Das Tcpconns-Plugin zählt TCP-Verbindungen auf einzelnen Ports.]]) + +-- collectd_tcpconns config section +s = m:section( NamedSection, "collectd_tcpconns", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_tcpconns.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_tcpconns.listeningports (ListeningPorts) +listeningports = s:option( Flag, "ListeningPorts", "Alle von lokalen Diensten genutzen Ports überwachen" ) +listeningports.default = 1 +listeningports:depends( "enable", 1 ) + +-- collectd_tcpconns.localports (LocalPort) +localports = s:option( Value, "LocalPorts", "Lokale Ports", "mit Leerzeichen trennen" ) +localports.optional = true +localports:depends( "enable", 1 ) + +-- collectd_tcpconns.remoteports (RemotePort) +remoteports = s:option( Value, "RemotePorts", "Entfernte Ports", "mit Leerzeichen trennen" ) +remoteports.optional = true +remoteports:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/cbi/luci_statistics/unixsock.lua b/applications/luci-statistics/src/model/cbi/luci_statistics/unixsock.lua new file mode 100644 index 000000000..dcedd381b --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/luci_statistics/unixsock.lua @@ -0,0 +1,46 @@ +--[[ + +Luci configuration model for statistics - collectd unixsock plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich + +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", "Unixsock Plugin", +[[Das Unixsock-Plugin öffnet einen Socket über welchen die gesammelten Werte des +laufenden collectd Prozesses abgefragt werden können.]]) + +-- collectd_unixsock config section +s = m:section( NamedSection, "collectd_unixsock", "luci_statistics", "Pluginkonfiguration" ) + +-- collectd_unixsock.enable +enable = s:option( Flag, "enable", "Plugin aktivieren" ) +enable.default = 0 + +-- collectd_unixsock.socketfile (SocketFile) +socketfile = s:option( Value, "SocketFile", "Pfad für den Unix-Socket" ) +socketfile.default = "/var/run/collect-query.socket" +socketfile:depends( "enable", 1 ) + +-- collectd_unixsock.socketgroup (SocketGroup) +socketgroup = s:option( Value, "SocketGroup", "Dateibesitzergruppe für den Unix-Socket ändern" ) +socketgroup.default = "nobody" +socketgroup.rmempty = true +socketgroup.optional = true +socketgroup:depends( "enable", 1 ) + +-- collectd_unixsock.socketperms (SocketPerms) +socketperms = s:option( Value, "SocketPerms", "Dateiberechtigungen für den Unix-Socket ändern" ) +socketperms.default = "0770" +socketperms.rmempty = true +socketperms.optional = true +socketperms:depends( "enable", 1 ) + +return m diff --git a/applications/luci-statistics/src/model/menu/70luci-statistics.lua b/applications/luci-statistics/src/model/menu/70luci-statistics.lua deleted file mode 100644 index e53a0a0d4..000000000 --- a/applications/luci-statistics/src/model/menu/70luci-statistics.lua +++ /dev/null @@ -1,31 +0,0 @@ -add( "admin", "statistics", "Statistiken", 70 ) ---act( "apache", "Apache" ) ---act( "apcups", "Apcups" ) ---act( "ascent", "Ascent" ) ---act( "cpufreq", "Cpufreq" ) -act( "csv", "CSV" ) -act( "df", "Speicher" ) -act( "disk", "Festplatte" ) -act( "dns", "DNS" ) -act( "email", "E-Mail" ) -act( "exec", "Exec" ) -act( "interface", "Schnittstellen" ) -act( "iptables", "Firewall" ) -act( "irq", "Interrupts" ) -act( "logfile", "Protokolldateien" ) -act( "netlink", "Netlink" ) -act( "network", "Netzwerk" ) ---act( "nginx", "nginx Server" ) ---act( "ntpd", "NTP Server" ) -act( "ping", "Ping" ) ---act( "powerdns", "Powerdns Server" ) -act( "processes", "Prozesse" ) -act( "rrdtool", "RRDTool" ) ---act( "sensors", "Sensoren" ) ---act( "snmp", "SNMP Datenquellen" ) ---act( "syslog", "Systemlog" ) ---act( "tail", "Dateiverfolgung" ) ---act( "teamspeak2", "TeamSpeak 2" ) -act( "tcpconns", "TCP Verbindungen" ) -act( "unixsock", "UNIX Socket" ) ---act( "vmem", "Vmem" ) diff --git a/applications/luci-statistics/src/view/admin_statistics/index.htm b/applications/luci-statistics/src/view/admin_statistics/index.htm new file mode 100644 index 000000000..2c1befa50 --- /dev/null +++ b/applications/luci-statistics/src/view/admin_statistics/index.htm @@ -0,0 +1,8 @@ +<%+header%> + +

<%:stat Statistiken%>

+ +

<%:stat_desc Die Statistiken bauen auf Collectd auf und nutzen +RRD Tool um Graphen aus den erfassten Daten zu rendern.%>

+ +<%+footer%> diff --git a/applications/luci-statistics/src/view/admin_statistics/networkplugins.htm b/applications/luci-statistics/src/view/admin_statistics/networkplugins.htm new file mode 100644 index 000000000..0c6d7f7ad --- /dev/null +++ b/applications/luci-statistics/src/view/admin_statistics/networkplugins.htm @@ -0,0 +1,18 @@ +<%+header%> + +

<%:stat_networkplugins Netzwerkplugins%>

+ +

<%:stat_networkplugins_desc Netzwerkplugins sammeln Werte über offene TCP-Verbindung, allgemeines Verkehrsaufkommen +auf verschiedenen Schnittstellen, DNS-Verkehr u.v.m.%>

+ +

<%:stat_networkplugins_installed Installierte Netzwerkplugins:%> +

    + <% for plugin, desc in pairs(plugins) do %> + <% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %> +
  • <%=desc%>
  • + <% end %> + <% end %> +
+

+ +<%+footer%> diff --git a/applications/luci-statistics/src/view/admin_statistics/outputplugins.htm b/applications/luci-statistics/src/view/admin_statistics/outputplugins.htm new file mode 100644 index 000000000..ed8651407 --- /dev/null +++ b/applications/luci-statistics/src/view/admin_statistics/outputplugins.htm @@ -0,0 +1,19 @@ +<%+header%> + +

<%:stat_outputplugins Ausgabeplugins%>

+ +

<%:stat_outputplugins_desc Ausgabeplugins stellen verschiedene Möglichkeiten zur Speicherung +der Daten bereit. Es können auch mehrere Plugins gleichzeitig aktiviert werden um beispielsweise +die gesammelten Werte in RRD-Datenbanken zu sichern und zusätzlich über das Netzwerk zu versenden.%>

+ +

<%:stat_outputplugins_installed Installierte Ausgabeplugins:%> +

    + <% for plugin, desc in pairs(plugins) do %> + <% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %> +
  • <%=desc%>
  • + <% end %> + <% end %> +
+

+ +<%+footer%> diff --git a/applications/luci-statistics/src/view/admin_statistics/systemplugins.htm b/applications/luci-statistics/src/view/admin_statistics/systemplugins.htm new file mode 100644 index 000000000..cbb469a1f --- /dev/null +++ b/applications/luci-statistics/src/view/admin_statistics/systemplugins.htm @@ -0,0 +1,18 @@ +<%+header%> + +

<%:stat_systemplugins Systemplugins%>

+ +

<%:stat_systemplugins_desc Systemplugins sammeln Werte über den aktuellen Systemzustand und den Ressourcenverbrauch +auf dem Gerät.%>

+ +

<%:stat_systemplugins_installed Installierte Systemplugins:%> +

    + <% for plugin, desc in pairs(plugins) do %> + <% if ffluci.fs.isfile("/usr/lib/collectd/" .. plugin .. ".so") then %> +
  • <%=desc%>
  • + <% end %> + <% end %> +
+

+ +<%+footer%>