* luci/statistics: implement initial i18n support, added first translations, removed...
[project/luci.git] / applications / luci-statistics / luasrc / statistics / rrdtool / definitions / interface.lua
1 module("luci.statistics.rrdtool.definitions.interface", package.seeall)
2
3 function rrdargs( graph, host, plugin, plugin_instance )
4
5         --
6         -- traffic diagram
7         --
8         local traffic = {
9
10                 -- draw this diagram for each data instance
11                 per_instance = true,
12
13                 -- diagram data description
14                 data = {
15                         -- defined sources for data types, if ommitted assume a single DS named "value" (optional)
16                         sources = {
17                                 if_octets = { "tx", "rx" }
18                         },
19
20                         -- special options for single data lines
21                         options = {
22                                 if_octets__tx = {
23                                         total = true,           -- report total amount of bytes
24                                         color = "00ff00"        -- tx is green
25                                 },
26
27                                 if_octets__rx = {
28                                         flip  = true,           -- flip rx line
29                                         total = true,           -- report total amount of bytes
30                                         color = "0000ff"        -- rx is blue
31                                 }
32                         }
33                 }
34         }
35
36
37         --
38         -- packet diagram
39         --
40         local packets = {
41
42                 -- draw this diagram for each data instance
43                 per_instance = true,
44
45                 -- diagram data description
46                 data = {
47                         -- data type order
48                         types = { "if_packets", "if_errors" },
49
50                         -- defined sources for data types
51                         sources = {
52                                 if_packets = { "tx", "rx" },
53                                 if_errors  = { "tx", "rx" }
54                         },
55
56                         -- special options for single data lines
57                         options = {
58                                 -- processed packets (tx DS)
59                                 if_packets__tx = {
60                                         overlay = true,         -- don't summarize
61                                         total   = true,         -- report total amount of bytes
62                                         color   = "00ff00"      -- processed tx is green
63                                 },
64
65                                 -- processed packets (rx DS)
66                                 if_packets__rx = {
67                                         overlay = true,         -- don't summarize
68                                         flip    = true,         -- flip rx line
69                                         total   = true,         -- report total amount of bytes
70                                         color   = "0000ff"      -- processed rx is blue
71                                 },
72
73                                 -- packet errors (tx DS)
74                                 if_errors__tx = {
75                                         overlay = true,         -- don't summarize
76                                         total   = true,         -- report total amount of packets
77                                         color   = "ff5500"      -- tx errors are orange
78                                 },
79
80                                 -- packet errors (rx DS)
81                                 if_errors__rx = {
82                                         overlay = true,         -- don't summarize
83                                         flip    = true,         -- flip rx line
84                                         total   = true,         -- report total amount of packets
85                                         color   = "ff0000"      -- rx errors are red
86                                 }
87                         }
88                 }
89         }
90
91         return { traffic, packets }
92 end