]> git.99rst.org Git - openwrt-luci.git/blob
f7d55a89db58197b19268ca2751f133186456d98
[openwrt-luci.git] /
1 /* Licensed to the public under the Apache License 2.0. */
2
3 'use strict';
4
5 return L.Class.extend({
6 title: _('Netlink'),
7
8 rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
9 /*
10 * traffic diagram
11 */
12 var traffic = {
13 title: "%H: Netlink - Transfer on %pi",
14 vlabel: "Bytes/s",
15
16 /* diagram data description */
17 data: {
18 /* defined sources for data types, if omitted assume a single DS named "value" (optional) */
19 sources: {
20 if_octets: [ "tx", "rx" ]
21 },
22
23 /* special options for single data lines */
24 options: {
25 if_octets__tx: {
26 title: "Bytes (TX)",
27 total: true, /* report total amount of bytes */
28 color: "00ff00" /* tx is green */
29 },
30
31 if_octets__rx: {
32 title: "Bytes (RX)",
33 flip : true, /* flip rx line */
34 total: true, /* report total amount of bytes */
35 color: "0000ff" /* rx is blue */
36 }
37 }
38 }
39 };
40
41 /*
42 * packet diagram
43 */
44 var packets = {
45 title: "%H: Netlink - Packets on %pi",
46 vlabel: "Packets/s", detail: true,
47
48 /* diagram data description */
49 data: {
50 /* data type order */
51 types: [ "if_packets", "if_dropped", "if_errors" ],
52
53 /* defined sources for data types */
54 sources: {
55 if_packets: [ "tx", "rx" ],
56 if_dropped: [ "tx", "rx" ],
57 if_errors : [ "tx", "rx" ]
58 },
59
60 /* special options for single data lines */
61 options: {
62 /* processed packets (tx DS) */
63 if_packets__tx: {
64 weight : 2,
65 title : "Total (TX)",
66 overlay: true, /* don't summarize */
67 total : true, /* report total amount of bytes */
68 color : "00ff00" /* processed tx is green */
69 },
70
71 /* processed packets (rx DS) */
72 if_packets__rx: {
73 weight : 3,
74 title : "Total (RX)",
75 overlay: true, /* don't summarize */
76 flip : true, /* flip rx line */
77 total : true, /* report total amount of bytes */
78 color : "0000ff" /* processed rx is blue */
79 },
80
81 /* dropped packets (tx DS) */
82 if_dropped__tx: {
83 weight : 1,
84 title : "Dropped (TX)",
85 overlay: true, /* don't summarize */
86 total : true, /* report total amount of bytes */
87 color : "660055" /* dropped tx is ... dunno ;) */
88 },
89
90 /* dropped packets (rx DS) */
91 if_dropped__rx: {
92 weight : 4,
93 title : "Dropped (RX)",
94 overlay: true, /* don't summarize */
95 flip : true, /* flip rx line */
96 total : true, /* report total amount of bytes */
97 color : "ff00ff" /* dropped rx is violett */
98 },
99
100 /* packet errors (tx DS) */
101 if_errors__tx: {
102 weight : 0,
103 title : "Errors (TX)",
104 overlay: true, /* don't summarize */
105 total : true, /* report total amount of packets */
106 color : "ff5500" /* tx errors are orange */
107 },
108
109 /* packet errors (rx DS) */
110 if_errors__rx: {
111 weight : 5,
112 title : "Errors (RX)",
113 overlay: true, /* don't summarize */
114 flip : true, /* flip rx line */
115 total : true, /* report total amount of packets */
116 color : "ff0000" /* rx errors are red */
117 }
118 }
119 }
120 };
121
122 /*
123 * multicast diagram
124 */
125 var multicast = {
126 title: "%H: Netlink - Multicast on %pi",
127 vlabel: "Packets/s", detail: true,
128
129 /* diagram data description */
130 data: {
131 /* data type order */
132 types: [ "if_multicast" ],
133
134 /* special options for single data lines */
135 options: {
136 /* multicast packets */
137 if_multicast: {
138 title: "Packets",
139 total: true, /* report total amount of packets */
140 color: "0000ff" /* multicast is blue */
141 }
142 }
143 }
144 };
145
146 /*
147 * collision diagram
148 */
149 var collisions = {
150 title: "%H: Netlink - Collisions on %pi",
151 vlabel: "Collisions/s", detail: true,
152
153 /* diagram data description */
154 data: {
155 /* data type order */
156 types: [ "if_collisions" ],
157
158 /* special options for single data lines */
159 options: {
160 /* collision rate */
161 if_collisions: {
162 title: "Collisions",
163 total: true, /* report total amount of packets */
164 color: "ff0000" /* collsions are red */
165 }
166 }
167 }
168 };
169
170 /*
171 * error diagram
172 */
173 var errors = {
174 title: "%H: Netlink - Errors on %pi",
175 vlabel: "Errors/s", detail: true,
176
177 /* diagram data description */
178 data: {
179 /* data type order */
180 types: [ "if_tx_errors", "if_rx_errors" ],
181
182 /* data type instances */
183 instances: {
184 if_tx_errors: [ "aborted", "carrier", "fifo", "heartbeat", "window" ],
185 if_rx_errors: [ "length", "missed", "over", "crc", "fifo", "frame" ]
186 },
187
188 /* special options for single data lines */
189 options: {
190 if_tx_errors_aborted_value : { total: true, color: "ffff00", title: "Aborted (TX)" },
191 if_tx_errors_carrier_value : { total: true, color: "ffcc00", title: "Carrier (TX)" },
192 if_tx_errors_fifo_value : { total: true, color: "ff9900", title: "Fifo (TX)" },
193 if_tx_errors_heartbeat_value: { total: true, color: "ff6600", title: "Heartbeat (TX)" },
194 if_tx_errors_window_value : { total: true, color: "ff3300", title: "Window (TX)" },
195
196 if_rx_errors_length_value : { flip: true, total: true, color: "ff0000", title: "Length (RX)" },
197 if_rx_errors_missed_value : { flip: true, total: true, color: "ff0033", title: "Missed (RX)" },
198 if_rx_errors_over_value : { flip: true, total: true, color: "ff0066", title: "Over (RX)" },
199 if_rx_errors_crc_value : { flip: true, total: true, color: "ff0099", title: "CRC (RX)" },
200 if_rx_errors_fifo_value : { flip: true, total: true, color: "ff00cc", title: "Fifo (RX)" },
201 if_rx_errors_frame_value : { flip: true, total: true, color: "ff00ff", title: "Frame (RX)" }
202 }
203 }
204 };
205
206 return [ traffic, packets, multicast, collisions, errors ];
207 }
208 });
git clone https://git.99rst.org/PROJECT