aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPim van den Berg2013-06-29 05:22:54 -0400
committerPim van den Berg2014-03-23 11:42:52 +0100
commit66675980c73536e70d7abb104f6f0def732c12df (patch)
tree25445ba97806cd6e07c8664ca4e0819344de168c
parentplugin: add ipmi plugin (diff)
downloadapt-panopticon_cgp-66675980c73536e70d7abb104f6f0def732c12df.zip
apt-panopticon_cgp-66675980c73536e70d7abb104f6f0def732c12df.tar.gz
apt-panopticon_cgp-66675980c73536e70d7abb104f6f0def732c12df.tar.bz2
apt-panopticon_cgp-66675980c73536e70d7abb104f6f0def732c12df.tar.xz
plugin: add aggregation plugin
-rw-r--r--plugin/aggregation.php48
1 files changed, 48 insertions, 0 deletions
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 @@
1<?php
2
3# Collectd aggregation plugin
4
5require_once 'conf/common.inc.php';
6require_once 'inc/collectd.inc.php';
7
8## LAYOUT
9# aggregation-(plugin)-(calculate)/(type)-(type-instance).rrd
10
11$pi = explode("-", GET('pi'));
12
13switch($pi[0]) {
14 case 'cpu':
15 require_once 'type/GenericStacked.class.php';
16 $obj = new Type_GenericStacked($CONFIG);
17 $obj->data_sources = array('value');
18 $obj->order = array('idle', 'nice', 'user', 'wait', 'system', 'softirq', 'interrupt', 'steal');
19 $obj->ds_names = array(
20 'idle' => 'Idle',
21 'nice' => 'Nice',
22 'user' => 'User',
23 'wait' => 'Wait-IO',
24 'system' => 'System',
25 'softirq' => 'SoftIRQ',
26 'interrupt' => 'IRQ',
27 'steal' => 'Steal',
28 );
29 $obj->colors = array(
30 'idle' => 'e8e8e8',
31 'nice' => '00e000',
32 'user' => '0000ff',
33 'wait' => 'ffb000',
34 'system' => 'ff0000',
35 'softirq' => 'ff00ff',
36 'interrupt' => 'a000a0',
37 'steal' => '000000',
38 );
39 $obj->rrd_title = 'CPU usage';
40 $obj->rrd_title = sprintf('CPU usage (%s)', $pi[1]);
41 $obj->rrd_vertical = 'Jiffies';
42 $obj->rrd_format = '%5.2lf';
43 $obj->rrdtool_opts .= ' -u 100';
44
45 collectd_flush($obj->identifiers);
46 $obj->rrd_graph();
47 break;
48}