aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/collectd.inc.php
diff options
context:
space:
mode:
authorRohit Bhute2013-03-17 13:40:38 +0530
committerPim van den Berg2013-03-30 14:10:52 +0100
commit60fb79ac97869b8333621380828dd1b84a069990 (patch)
tree113b34e7c76dedfc9c9e9d050867a5f16b99aab0 /inc/collectd.inc.php
parentdetail.php: make terms configurable (diff)
downloadapt-panopticon_cgp-60fb79ac97869b8333621380828dd1b84a069990.zip
apt-panopticon_cgp-60fb79ac97869b8333621380828dd1b84a069990.tar.gz
apt-panopticon_cgp-60fb79ac97869b8333621380828dd1b84a069990.tar.bz2
apt-panopticon_cgp-60fb79ac97869b8333621380828dd1b84a069990.tar.xz
add feature to show a subset of graphs from a plugin on overview page
Diffstat (limited to '')
-rw-r--r--inc/collectd.inc.php13
1 files changed, 12 insertions, 1 deletions
diff --git a/inc/collectd.inc.php b/inc/collectd.inc.php
index 56c5a2d..e8f3662 100644
--- a/inc/collectd.inc.php
+++ b/inc/collectd.inc.php
@@ -147,14 +147,25 @@ function plugin_sort($data) {
147} 147}
148 148
149# generate graph url's for a plugin of a host 149# generate graph url's for a plugin of a host
150function graphs_from_plugin($host, $plugin) { 150function graphs_from_plugin($host, $plugin, $overview=false) {
151 global $CONFIG; 151 global $CONFIG;
152 152
153 $plugindata = collectd_plugindata($host, $plugin); 153 $plugindata = collectd_plugindata($host, $plugin);
154 $plugindata = group_plugindata($plugindata); 154 $plugindata = group_plugindata($plugindata);
155 $plugindata = plugin_sort($plugindata); 155 $plugindata = plugin_sort($plugindata);
156 156
157 $f = array();
158
159 if ($overview == true && isset($CONFIG['overview_filter'][$plugin])) {
160 $f = $CONFIG['overview_filter'][$plugin];
161 }
162
157 foreach ($plugindata as $items) { 163 foreach ($plugindata as $items) {
164
165 if (!empty($f) && ($f !== array_intersect_assoc($f, $items))) {
166 continue;
167 }
168
158 $items['h'] = $host; 169 $items['h'] = $host;
159 170
160 $time = array_key_exists($plugin, $CONFIG['time_range']) 171 $time = array_key_exists($plugin, $CONFIG['time_range'])