aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPim van den Berg2010-01-01 20:22:23 +0100
committerPim van den Berg2010-01-01 20:22:23 +0100
commit90299a0c77e592cd5d25d9610357f65d33c778a6 (patch)
treeeed9e8fe3fcf68bef47e91ac9bd33a44cc352822
parentbetter validation of possible user input (get) (diff)
downloadapt-panopticon_cgp-90299a0c77e592cd5d25d9610357f65d33c778a6.zip
apt-panopticon_cgp-90299a0c77e592cd5d25d9610357f65d33c778a6.tar.gz
apt-panopticon_cgp-90299a0c77e592cd5d25d9610357f65d33c778a6.tar.bz2
apt-panopticon_cgp-90299a0c77e592cd5d25d9610357f65d33c778a6.tar.xz
show all type instances in one graph
Planned for collectd version 5.0 is to move the type instance of plugins df and interface to the plugin instance (see source). From version 5.0 the default is to group data from a type instance OR data source in one graph. In case of version 4 there are only 2 plugins to exclude from this: df and interface. Source: http://collectd.org/wiki/index.php/Plans_for_5.0
-rw-r--r--conf/config.php13
-rw-r--r--inc/collectd.inc.php4
2 files changed, 6 insertions, 11 deletions
diff --git a/conf/config.php b/conf/config.php
index da23449..149348a 100644
--- a/conf/config.php
+++ b/conf/config.php
@@ -1,5 +1,8 @@
1<?php 1<?php
2 2
3# collectd version
4$CONFIG['version'] = 4;
5
3# collectd's datadir 6# collectd's datadir
4$CONFIG['datadir'] = '/var/lib/collectd/rrd'; 7$CONFIG['datadir'] = '/var/lib/collectd/rrd';
5 8
@@ -21,16 +24,6 @@ $CONFIG['detail-heigth'] = 350;
21# disabled: NULL 24# disabled: NULL
22$CONFIG['socket'] = NULL; 25$CONFIG['socket'] = NULL;
23 26
24# group data to show in a graph
25# XXX: these settings have to move to their plugins
26$CONFIG['groupby'] = array(
27 'cpu' => 'type',
28 'irq' => 'type',
29 'memory' => 'type',
30 'processes' => 'type',
31 'swap' => 'type',
32 'sensors' => 'type',
33);
34 27
35# load local configuration 28# load local configuration
36if (file_exists(dirname(__FILE__).'/config.local.php')) 29if (file_exists(dirname(__FILE__).'/config.local.php'))
diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php
index ab4340f..fde3267 100644
--- a/inc/collectd.inc.php
+++ b/inc/collectd.inc.php
@@ -112,7 +112,9 @@ function graphs_from_plugin($host, $plugin) {
112 $ts = collectd_plugindetail($host, $plugin, 't'); 112 $ts = collectd_plugindetail($host, $plugin, 't');
113 $tis = collectd_plugindetail($host, $plugin, 'ti'); 113 $tis = collectd_plugindetail($host, $plugin, 'ti');
114 if (!$pis) $pis = array('NULL'); 114 if (!$pis) $pis = array('NULL');
115 if (!$tis || $CONFIG['groupby'][$plugin] == 'type') 115 if (!$tis) $tis = array('NULL');
116 # backwards compatibility
117 if ($CONFIG['version'] >= 5 || !preg_match('/^(df|interface)$/', $plugin))
116 $tis = array('NULL'); 118 $tis = array('NULL');
117 119
118 foreach($pis as $pi) { 120 foreach($pis as $pi) {