From 66675980c73536e70d7abb104f6f0def732c12df Mon Sep 17 00:00:00 2001 From: Pim van den Berg Date: Sat, 29 Jun 2013 05:22:54 -0400 Subject: plugin: add aggregation plugin --- plugin/aggregation.php | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 plugin/aggregation.php (limited to 'plugin') diff --git a/plugin/aggregation.php b/plugin/aggregation.php new file mode 100644 index 0000000..625ec33 --- /dev/null +++ b/plugin/aggregation.php @@ -0,0 +1,48 @@ +data_sources = array('value'); + $obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal'); + $obj->ds_names = array( + 'idle' => 'Idle', + 'nice' => 'Nice', + 'user' => 'User', + 'wait' => 'Wait-IO', + 'system' => 'System', + 'softirq' => 'SoftIRQ', + 'interrupt' => 'IRQ', + 'steal' => 'Steal', + ); + $obj->colors = array( + 'idle' => 'e8e8e8', + 'nice' => '00e000', + 'user' => '0000ff', + 'wait' => 'ffb000', + 'system' => 'ff0000', + 'softirq' => 'ff00ff', + 'interrupt' => 'a000a0', + 'steal' => '000000', + ); + $obj->rrd_title = 'CPU usage'; + $obj->rrd_title = sprintf('CPU usage (%s)', $pi[1]); + $obj->rrd_vertical = 'Jiffies'; + $obj->rrd_format = '%5.2lf'; + $obj->rrdtool_opts .= ' -u 100'; + + collectd_flush($obj->identifiers); + $obj->rrd_graph(); + break; +} -- cgit v1.1