aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/host.php
diff options
context:
space:
mode:
Diffstat (limited to 'host.php')
-rw-r--r--host.php36
1 files changed, 14 insertions, 22 deletions
diff --git a/host.php b/host.php
index 8e3b695..6799123 100644
--- a/host.php
+++ b/host.php
@@ -5,7 +5,14 @@ require_once 'inc/html.inc.php';
5require_once 'inc/collectd.inc.php'; 5require_once 'inc/collectd.inc.php';
6 6
7$host = validate_get(GET('h'), 'host'); 7$host = validate_get(GET('h'), 'host');
8$splugin = validate_get(GET('p'), 'plugin'); 8$plugin = validate_get(GET('p'), 'plugin');
9
10if (!$plugin) {
11 $selected_plugins = $CONFIG['overview'];
12}
13else {
14 $selected_plugins = array($plugin);
15}
9 16
10html_start(); 17html_start();
11 18
@@ -18,29 +25,14 @@ if(!$plugins) {
18 return false; 25 return false;
19} 26}
20 27
21# first the ones defined in overview 28plugins_list($host, $CONFIG['overview'], $plugins, $selected_plugins);
22foreach($CONFIG['overview'] as $plugin) {
23 if (in_array($plugin, $plugins)) {
24 printf('<div id="%s">'."\n", $plugin);
25 plugin_header($host, $plugin, 0);
26 graphs_from_plugin($host, $plugin);
27 print "</div>\n";
28 }
29}
30 29
31# other plugins 30echo '<div class="graphs">';
32foreach($plugins as $plugin) { 31foreach ($selected_plugins as $selected_plugin) {
33 if (!in_array($plugin, $CONFIG['overview'])) { 32 plugin_header($host, $selected_plugin);
34 printf('<div id="%s">'."\n", $plugin); 33 graphs_from_plugin($host, $selected_plugin);
35 if ($splugin == $plugin) {
36 plugin_header($host, $plugin, 0);
37 graphs_from_plugin($host, $plugin);
38 } else {
39 plugin_header($host, $plugin, 1);
40 }
41 print "</div>\n";
42 }
43} 34}
35echo '</div><! .graphs -->';
44 36
45html_end(); 37html_end();
46 38