2 * Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
3 * Licensed to the public under the Apache License 2.0.
9 return baseclass.extend({
12 rrdargs: function(graph, host, plugin, plugin_instance, dtype) {
15 if (plugin_instance == "routes") {
17 /* diagram data description */
18 title: "%H: Total amount of OLSR routes",
20 number_format: "%5.0lf",
26 title: "Total number of routes"
31 title: "%H: Average route ETX",
34 number_format: "%5.1lf",
36 instances: [ "average" ], /* falls es irgendwann mal welche pro ip gibt, wie bei links, dann werden die hier excludiert */
37 types: [ "route_etx" ],
40 title: "Average route ETX"
45 title: "%H: Average route metric",
48 number_format: "%5.1lf",
50 instances: [ "average" ], /* falls es irgendwann mal welche pro ip gibt, wie bei links, dann werden die hier excludiert */
51 types: [ "route_metric" ],
54 title: "Average route metric"
60 else if (plugin_instance == "links") {
62 /* diagram data description */
63 title: "%H: Total amount of OLSR neighbours",
65 number_format: "%5.0lf",
72 title: "Number of neighbours"
78 var instances = graph.dataInstances(host, plugin, plugin_instance, "signal_quality").sort();
80 /* define one diagram per host, containing the rx and lq values */
81 for (var i = 0; i < instances.length; i += 2) {
82 var dsn1 = "signal_quality_%s_value".format(instances[i].replace(/\W+/g, '_')),
83 dsn2 = "signal_quality_%s_value".format(instances[i+1].replace(/\W+/g, '_')),
84 host = instances[i].match(/^[^-]+-([^-]+)-.+$/),
85 host = host ? host[1] : 'avg',
88 opts[dsn1] = { color: "00ff00", title: "LQ (%s)".format(host) };
89 opts[dsn2] = { color: "0000ff", title: "NLQ (%s)".format(host), flip: true };
92 title: "%H: Signal Quality (%s)".format(host), vlabel: "ETX",
93 number_format: "%5.2lf", detail: true,
95 types: [ "signal_quality" ],
98 signal_quality: [ instances[i], instances[i+1] ],
106 else if (plugin_instance == "topology") {
108 title: "%H: Total amount of OLSR links",
110 number_format: "%5.0lf",
117 title: "Total number of links"
122 title: "%H: Average signal quality",
124 number_format: "%5.2lf",
127 instances: [ "average" ], /* exclude possible per-ip stuff */
128 types: [ "signal_quality" ],
132 title: "Average signal quality"