diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2008-05-21 03:08:47 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2008-05-21 03:08:47 +0000 |
commit | 5306660d04e81b15d7338ccb3e5229ba1e6dc129 (patch) | |
tree | ab0816b5e2d7993653eb3cf682544a5571c94ad8 /applications/luci-statistics/src | |
parent | f77474efc7181610420681e2871186b03e0ade73 (diff) |
* ffluci/statistics: add cbi models for irq, netlink and network plugins, updated menu, default config and config generator
Diffstat (limited to 'applications/luci-statistics/src')
4 files changed, 213 insertions, 15 deletions
diff --git a/applications/luci-statistics/src/model/cbi/admin_statistics/irq.lua b/applications/luci-statistics/src/model/cbi/admin_statistics/irq.lua new file mode 100644 index 000000000..2d15e5232 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/admin_statistics/irq.lua @@ -0,0 +1,39 @@ +--[[ + +Luci configuration model for statistics - collectd irq plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +]]-- + +m = Map("luci_statistics", "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 new file mode 100644 index 000000000..f027f3778 --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/admin_statistics/netlink.lua @@ -0,0 +1,84 @@ +--[[ + +Luci configuration model for statistics - collectd netlink plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +]]-- + +require("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.classs (Class) +classs = s:option( MultiValue, "Classs", "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 new file mode 100644 index 000000000..ab3c6303c --- /dev/null +++ b/applications/luci-statistics/src/model/cbi/admin_statistics/network.lua @@ -0,0 +1,84 @@ +--[[ + +Luci configuration model for statistics - collectd network plugin configuration +(c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net> + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +$Id$ + +]]-- + + +m = Map("luci_statistics", "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/menu/70luci-statistics.lua b/applications/luci-statistics/src/model/menu/70luci-statistics.lua index 3e3405fd0..c28c1fc28 100644 --- a/applications/luci-statistics/src/model/menu/70luci-statistics.lua +++ b/applications/luci-statistics/src/model/menu/70luci-statistics.lua @@ -9,32 +9,23 @@ act( "disk", "Festplatte" ) act( "dns", "DNS" ) act( "email", "E-Mail" ) act( "exec", "Exec" ) ---act( "hddtemp", "Festplattentemperatur" ) act( "interface", "Schnittstellen" ) act( "iptables", "Firewall" ) ---act( "irq", "Interrupts" ) ---act( "libvirt", "Virtualisierung" ) ---act( "logfile", "Protokolldateien" ) ---act( "mbmon", "Mainboardsensoren" ) ---act( "memcached", "Memcached" ) ---act( "mysql", "MySQL" ) ---act( "netlink", "Netlink" ) ---act( "network", "Netzwerk" ) +act( "irq", "Interrupts" ) +act( "logfile", "Protokolldateien" ) +act( "netlink", "Netlink" ) +act( "network", "Netzwerk" ) --act( "nginx", "nginx Server" ) --act( "ntpd", "NTP Server" ) ---act( "nut", "Nut" ) ---act( "perl", "Perl" ) act( "ping", "Ping" ) --act( "powerdns", "Powerdns Server" ) -act( "processes", "Prozesse" ) +--act( "processes", "Prozesse" ) --act( "rrdtool", "RRD Tool" ) --act( "sensors", "Sensoren" ) --act( "snmp", "SNMP Datenquellen" ) --act( "syslog", "Systemlog" ) --act( "tail", "Dateiverfolgung" ) --act( "teamspeak2", "TeamSpeak 2" ) -act( "tcpconns", "TCP Verbindungen" ) +--act( "tcpconns", "TCP Verbindungen" ) --act( "unixsock", "UNIX Sockets" ) ---act( "uuid", "UUID" ) --act( "vmem", "Vmem" ) ---act( "vserver", "VServer" ) |