diff options
Diffstat (limited to 'inc')
| -rw-r--r-- | inc/collectd.inc.php | 13 |
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 |
| 150 | function graphs_from_plugin($host, $plugin) { | 150 | function 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']) |
