1 -- Copyright 2011 Manuel Munz <freifunk at somakoma dot de>
2 -- Licensed to the public under the Apache License 2.0.
4 module("luci.statistics.rrdtool.definitions.olsrd", package.seeall)
7 return luci.i18n.translate("OLSRd")
10 function rrdargs( graph, plugin, plugin_instance, dtype )
13 if plugin_instance == "routes" then
16 -- diagram data description
17 title = "%H: Total amount of OLSR routes", vlabel = "n",
18 number_format = "%5.0lf", data = {
23 title = "Total number of routes"
30 title = "%H: Average route ETX", vlabel = "ETX", detail = true,
31 number_format = "%5.1lf",data = {
32 instances = { "average" }, -- falls es irgendwann mal welche pro ip gibt, wie bei links, dann werden die hier excludiert
33 types = { "route_etx" },
36 title = "Average route ETX"
43 title = "%H: Average route metric", vlabel = "metric", detail = true,
44 number_format = "%5.1lf", data = {
45 instances = { "average" }, -- falls es irgendwann mal welche pro ip gibt, wie bei links, dann werden die hier excludiert
46 types = { "route_metric" },
49 title = "Average route metric"
55 elseif plugin_instance == "links" then
58 -- diagram data description
59 title = "%H: Total amount of OLSR neighbours", vlabel = "n",
60 number_format = "%5.0lf", data = {
66 title = "Number of neighbours"
72 local instances = graph.tree:data_instances(plugin, plugin_instance, "signal_quality")
75 -- define one diagram per host, containing the rx and lq values
77 for i = 1, #instances, 2 do
78 local dsn1 = "signal_quality_%s_value" % instances[i]:gsub("[^%w]+", "_")
79 local dsn2 = "signal_quality_%s_value" % instances[i+1]:gsub("[^%w]+", "_")
80 local host = instances[i]:match("^[^%-]+%-([^%-]+)%-.+")
83 title = "%H: Signal Quality" .. " (" .. (host or "avg") ..")", vlabel = "ETX",
84 number_format = "%5.2lf", detail = true,
86 types = { "signal_quality" },
89 signal_quality = { instances[i], instances[i+1] },
95 title = "LQ (%s)" % (host or "avg"),
99 title = "NLQ (%s)" % (host or "avg"),
107 elseif plugin_instance == "topology" then
110 title= "%H: Total amount of OLSR links", vlabel = "n",
111 number_format = "%5.0lf", data = {
117 title = "Total number of links"
124 title= "%H: Average signal quality", vlabel = "n",
125 number_format = "%5.2lf", detail = true,
127 instances = { "average" }, -- exclude possible per-ip stuff
128 types = { "signal_quality" },
132 title = "Average signal quality"