commit 4f6198094cf4134179d1f9c9fa8f79759a27c87e
[project/luci.git] / applications / luci-statistics / luasrc / model / cbi / luci_statistics / exec.lua
1 --[[
2
3 Luci configuration model for statistics - collectd exec plugin configuration
4 (c) 2008 Freifunk Leipzig / Jo-Philipp Wich <xm@leipzig.freifunk.net>
5
6 Licensed under the Apache License, Version 2.0 (the "License");
7 you may not use this file except in compliance with the License.
8 You may obtain a copy of the License at
9
10         http://www.apache.org/licenses/LICENSE-2.0
11
12 $Id$
13
14 ]]--
15
16 m = Map("luci_statistics", "Exec Plugin",
17 [[Das Exec-Plugin ermöglicht das Ausführen von externen Programmen um Werte einzulesen
18 oder Aktionen beim Eintreten bestimmter Ereignisse anzustoßen.]])
19
20 -- collectd_exec config section
21 s = m:section( NamedSection, "collectd_exec", "luci_statistics", "Pluginkonfiguration" )
22
23 -- collectd_exec.enable
24 enable = s:option( Flag, "enable", "Plugin aktivieren" )
25 enable.default = 0
26
27
28 -- collectd_exec_input config section (Exec directives)
29 exec = m:section( TypedSection, "collectd_exec_input", "Befehl zum Einlesen von Daten hinzufügen",
30 [[Hier können externe Kommandos definiert werden welche durch collectd gestartet werden um bestimmte
31 Daten zu sammeln. Die Werte werden dabei von der Standardausgabe des Programmes gelesen.]])
32 exec.addremove = true
33 exec.anonymous = true
34
35 -- collectd_exec_input.cmdline
36 exec_cmdline = exec:option( Value, "cmdline", "Kommandozeile" )
37 exec_cmdline.default = "/usr/bin/stat-dhcpusers"
38
39 -- collectd_exec_input.cmdline
40 exec_cmduser = exec:option( Value, "cmduser", "Als anderer Benutzer ausführen" )
41 exec_cmduser.default  = "nobody"
42 exec_cmduser.rmempty  = true
43 exec_cmduser.optional = true
44
45 -- collectd_exec_input.cmdline
46 exec_cmdgroup = exec:option( Value, "cmdgroup", "Als andere Gruppe ausführen" )
47 exec_cmdgroup.default  = "nogroup"
48 exec_cmdgroup.rmempty  = true
49 exec_cmdgroup.optional = true
50
51
52 -- collectd_exec_notify config section (NotifyExec directives)
53 notify = m:section( TypedSection, "collectd_exec_notify", "Befehl zum Ausgeben von Daten hinzufügen",
54 [[Hier können externe Kommandos definiert werden welche zur Ausführung kommen sobald bestimmte
55 Ereignise eintreten. Die Daten werden dabei an die Standardeingabe des aufgerufenen Programmes gesendet.
56 Siehe dazu auch die Sektion "Limits".]])
57 notify.addremove = true
58 notify.anonymous = true
59
60 -- collectd_notify_input.cmdline
61 notify_cmdline = notify:option( Value, "cmdline", "Kommandozeile" )
62 notify_cmdline.default = "/usr/bin/stat-dhcpusers"
63
64 -- collectd_notify_input.cmdline
65 notify_cmduser = notify:option( Value, "cmduser", "Als anderer Benutzer ausführen" )
66 notify_cmduser.default  = "nobody"
67 notify_cmduser.rmempty  = true
68 notify_cmduser.optional = true
69
70 -- collectd_notify_input.cmdline
71 notify_cmdgroup = notify:option( Value, "cmdgroup", "Als andere Gruppe ausführen" )
72 notify_cmdgroup.default  = "nogroup"
73 notify_cmdgroup.rmempty  = true
74 notify_cmdgroup.optional = true
75
76
77 return m