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", vlabel: "n",
19 number_format: "%5.0lf", data: {
24 title: "Total number of routes"
29 title: "%H: Average route ETX", vlabel: "ETX", detail: true,
30 number_format: "%5.1lf", data: {
31 instances: [ "average" ], /* falls es irgendwann mal welche pro ip gibt, wie bei links, dann werden die hier excludiert */
32 types: [ "route_etx" ],
35 title: "Average route ETX"
40 title: "%H: Average route metric", vlabel: "metric", detail: true,
41 number_format: "%5.1lf", data: {
42 instances: [ "average" ], /* falls es irgendwann mal welche pro ip gibt, wie bei links, dann werden die hier excludiert */
43 types: [ "route_metric" ],
46 title: "Average route metric"
52 else if (plugin_instance == "links") {
54 /* diagram data description */
55 title: "%H: Total amount of OLSR neighbours", vlabel: "n",
56 number_format: "%5.0lf", data: {
62 title: "Number of neighbours"
68 var instances = graph.dataInstances(host, plugin, plugin_instance, "signal_quality").sort();
70 /* define one diagram per host, containing the rx and lq values */
71 for (var i = 0; i < instances.length; i += 2) {
72 var dsn1 = "signal_quality_%s_value".format(instances[i].replace(/\W+/g, '_')),
73 dsn2 = "signal_quality_%s_value".format(instances[i+1].replace(/\W+/g, '_')),
74 host = instances[i].match(/^[^-]+-([^-]+)-.+$/),
75 host = host ? host[1] : 'avg',
78 opts[dsn1] = { color: "00ff00", title: "LQ (%s)".format(host) };
79 opts[dns2] = { color: "0000ff", title: "NLQ (%s)".format(host), flip: true };
82 title: "%H: Signal Quality (%s)".format(host), vlabel: "ETX",
83 number_format: "%5.2lf", detail: true,
85 types: [ "signal_quality" ],
88 signal_quality: [ instances[i], instances[i+1] ],
96 else if (plugin_instance == "topology") {
98 title: "%H: Total amount of OLSR links", vlabel: "n",
99 number_format: "%5.0lf", data: {
105 title: "Total number of links"
110 title: "%H: Average signal quality", vlabel: "n",
111 number_format: "%5.2lf", detail: true,
113 instances: [ "average" ], /* exclude possible per-ip stuff */
114 types: [ "signal_quality" ],
118 title: "Average signal quality"