summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/ping/ping.lua
blob: b041c015daf67acb9d038e7ad4e8495a33b6d210 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
module("luci.statistics.rrdtool.definitions.ping.ping", package.seeall)

function rrdargs( graph, host, plugin, plugin_instance, dtype )

	dtype_instances = graph.tree:data_instances( plugin, plugin_instance, dtype )

	opts = { }
	opts.sources	= { }
	opts.image	= graph:mkpngpath( host, plugin, plugin_instance, dtype )
	opts.title	= host .. ": Pingzeiten"
	opts.rrd 	= { "-v", "Millisekunden" }
	opts.colors     = { }

	for i, inst in ipairs(dtype_instances) do
		opts.sources[i] = {
			ds   = "ping",
			name = inst,
			rrd  = graph:mkrrdpath( host, plugin, plugin_instance, dtype, inst )
		}
	end

	return opts
end