From 60fb79ac97869b8333621380828dd1b84a069990 Mon Sep 17 00:00:00 2001 From: Rohit Bhute Date: Sun, 17 Mar 2013 13:40:38 +0530 Subject: add feature to show a subset of graphs from a plugin on overview page --- inc/collectd.inc.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'inc/collectd.inc.php') 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) { } # generate graph url's for a plugin of a host -function graphs_from_plugin($host, $plugin) { +function graphs_from_plugin($host, $plugin, $overview=false) { global $CONFIG; $plugindata = collectd_plugindata($host, $plugin); $plugindata = group_plugindata($plugindata); $plugindata = plugin_sort($plugindata); + $f = array(); + + if ($overview == true && isset($CONFIG['overview_filter'][$plugin])) { + $f = $CONFIG['overview_filter'][$plugin]; + } + foreach ($plugindata as $items) { + + if (!empty($f) && ($f !== array_intersect_assoc($f, $items))) { + continue; + } + $items['h'] = $host; $time = array_key_exists($plugin, $CONFIG['time_range']) -- cgit v1.1