c61d4f291203883bfe319e9c5cb572823d71c118
[oweals/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: _('Conntrack'),
7
8         rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
9                 var entries = {
10                         title: "%H: Conntrack entries",
11                         vlabel: "Count",
12                         number_format: "%5.0lf",
13                         data: {
14                                 /* collectd 5.5+: specify "" to exclude "max" instance */
15                                 instances: {
16                                         conntrack: [ "" ]
17                                 },
18                                 sources: {
19                                         conntrack: [ "value" ]
20                                 },
21                                 options: {
22                                         conntrack: {
23                                                 color: "0000ff",
24                                                 title: "Tracked connections"
25                                         }
26                                 }
27                         }
28                 };
29
30                 var percent = {
31                         title: "%H: Conntrack usage",
32                         vlabel: "Percent",
33                         number_format: "%5.1lf%%",
34                         y_min: "0",
35                         alt_autoscale_max: true,
36                         data: {
37                                 instances: {
38                                         percent: [ "used" ]
39                                 },
40                                 options: {
41                                         percent_used: {
42                                                 color: "00ff00",
43                                                 title: "Used"
44                                         }
45                                 }
46                         }
47                 };
48
49                 return [ entries, percent ];
50         }
51 });