summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-statistics/src/statistics/rrdtool/definitions/cpu/cpu.lua
blob: 2626d276d1dd067bd2fb54bc77e873b2ebaf82d0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
module("luci.statistics.rrdtool.definitions.cpu.cpu",package.seeall)

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

	dtype_instances = { "idle", "nice", "system", "user" }

	opts = { }
	opts.sources	= { }
	opts.image	= graph:mkpngpath( host, plugin, plugin_instance, dtype )
	opts.title	= host .. ": Prozessorauslastung"
	opts.rrd 	= { "-v", "Percent" }
	opts.colors	= {
		idle      = 'ffffff',
		nice      = '00e000',
		user      = '0000ff',
		wait      = 'ffb000',
		system    = 'ff0000',
		softirq   = 'ff00ff',
		interrupt = 'a000a0',
		steal     = '000000'
	}

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

	return opts
end