* ffluci/statistics: first bunch of collectd plugin cbi models
This commit is contained in:
parent
69897e5ad9
commit
89782b126f
8 changed files with 348 additions and 8 deletions
|
@ -0,0 +1,39 @@
|
|||
--[[
|
||||
|
||||
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", "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
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
--[[
|
||||
|
||||
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", "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
|
|
@ -0,0 +1,37 @@
|
|||
--[[
|
||||
|
||||
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", "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
|
|
@ -0,0 +1,44 @@
|
|||
--[[
|
||||
|
||||
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("ffluci.model.uci")
|
||||
|
||||
|
||||
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.model.uci.sections("network")) do
|
||||
if v[".type"] == "interface" and k ~= "loopback" then
|
||||
interfaces:value(k)
|
||||
end
|
||||
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
|
|
@ -0,0 +1,55 @@
|
|||
--[[
|
||||
|
||||
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", "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.socket"
|
||||
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
|
|
@ -0,0 +1,77 @@
|
|||
--[[
|
||||
|
||||
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", "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
|
|
@ -16,28 +16,28 @@ $Id$
|
|||
require("ffluci.sys")
|
||||
|
||||
|
||||
m = Map("collectd", "Collector Daemon",
|
||||
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.]])
|
||||
gespeichert oder per Multicast Relaying über das Netzwerk versendet.]])
|
||||
|
||||
-- general config section
|
||||
s = m:section( NamedSection, "general", "collectd", "Allgemeine Einstellungen" )
|
||||
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 = 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 = 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 = s:option( Value, "PluginDir", "Verzeichnis für die Collector-Plugins" )
|
||||
plugindir.default = "/usr/lib/collectd/"
|
||||
|
||||
-- general.typesdb (TypesDB)
|
||||
|
@ -45,12 +45,12 @@ 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 in Sekunden" )
|
||||
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 = s:option( Value, "ReadThreads", "Anzahl paralleler Prozesse für die Datenabfrage" )
|
||||
readthreads.default = 5
|
||||
readthreads.isnumber = true
|
||||
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
--[[
|
||||
|
||||
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", "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
|
Loading…
Reference in a new issue