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)
6 function rrdargs( graph, plugin, plugin_instance, dtype )
9 if plugin_instance == "routes" then
12 -- diagram data description
13 title = "%H: Total amount of OLSR routes", vlabel = "n",
14 number_format = "%5.0lf", data = {
19 title = "Total number of routes"
26 title = "%H: Average route ETX", vlabel = "ETX", detail = true,
27 number_format = "%5.1lf",data = {
28 instances = { "average" }, -- falls es irgendwann mal welche pro ip gibt, wie bei links, dann werden die hier excludiert
29 types = { "route_etx" },
32 title = "Average route ETX"
39 title = "%H: Average route metric", vlabel = "metric", detail = true,
40 number_format = "%5.1lf", data = {
41 instances = { "average" }, -- falls es irgendwann mal welche pro ip gibt, wie bei links, dann werden die hier excludiert
42 types = { "route_metric" },
45 title = "Average route metric"
51 elseif plugin_instance == "links" then
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 local instances = graph.tree:data_instances(plugin, plugin_instance, "signal_quality")
71 -- define one diagram per host, containing the rx and lq values
73 for i = 1, #instances, 2 do
74 local dsn1 = "signal_quality_%s_value" % instances[i]:gsub("[^%w]+", "_")
75 local dsn2 = "signal_quality_%s_value" % instances[i+1]:gsub("[^%w]+", "_")
76 local host = instances[i]:match("^[^%-]+%-([^%-]+)%-.+")
79 title = "%H: Signal Quality" .. " (" .. (host or "avg") ..")", vlabel = "ETX",
80 number_format = "%5.2lf", detail = true,
82 types = { "signal_quality" },
85 signal_quality = { instances[i], instances[i+1] },
91 title = "LQ (%s)" % (host or "avg"),
95 title = "NLQ (%s)" % (host or "avg"),
103 elseif plugin_instance == "topology" then
106 title= "%H: Total amount of OLSR links", vlabel = "n",
107 number_format = "%5.0lf", data = {
113 title = "Total number of links"
120 title= "%H: Average signal quality", vlabel = "n",
121 number_format = "%5.2lf", detail = true,
123 instances = { "average" }, -- exclude possible per-ip stuff
124 types = { "signal_quality" },
128 title = "Average signal quality"