-
Notifications
You must be signed in to change notification settings - Fork 0
/
host.php
47 lines (37 loc) · 953 Bytes
/
host.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
require_once 'conf/common.inc.php';
require_once 'inc/html.inc.php';
require_once 'inc/collectd.inc.php';
$host = validate_get(GET('h'), 'host');
$splugin = validate_get(GET('p'), 'plugin');
html_start();
printf('<h2>%s</h2>'."\n", get_host_alias($host));
$plugins = collectd_plugins($host);
if(!$plugins) {
echo "Unknown host\n";
return false;
}
# first the ones defined in overview
foreach($CONFIG['overview'] as $plugin) {
if (in_array($plugin, $plugins)) {
printf('<div id="%s">'."\n", $plugin);
plugin_header($host, $plugin, 0);
graphs_from_plugin($host, $plugin);
print "</div>\n";
}
}
# other plugins
foreach($plugins as $plugin) {
if (!in_array($plugin, $CONFIG['overview'])) {
printf('<div id="%s">'."\n", $plugin);
if ($splugin == $plugin) {
plugin_header($host, $plugin, 0);
graphs_from_plugin($host, $plugin);
} else {
plugin_header($host, $plugin, 1);
}
print "</div>\n";
}
}
html_end();
?>