summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu/cpu.lua
diff options
context:
space:
mode:
Diffstat (limited to 'applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu/cpu.lua')
-rw-r--r--applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu/cpu.lua31
1 files changed, 31 insertions, 0 deletions
diff --git a/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu/cpu.lua b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu/cpu.lua
new file mode 100644
index 000000000..2626d276d
--- /dev/null
+++ b/applications/luci-statistics/luasrc/statistics/rrdtool/definitions/cpu/cpu.lua
@@ -0,0 +1,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