aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/host.php
blob: 6799123c9efaf4a3dbeee4dbea7782791b88a918 (plain)
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
<?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');
$plugin = validate_get(GET('p'), 'plugin');

if (!$plugin) {
	$selected_plugins = $CONFIG['overview'];
}
else {
	$selected_plugins = array($plugin);
}

html_start();

printf('<h2>%s</h2>'."\n", $host);

$plugins = collectd_plugins($host);

if(!$plugins) {
	echo "Unknown host\n";
	return false;
}

plugins_list($host, $CONFIG['overview'], $plugins, $selected_plugins);

echo '<div class="graphs">';
foreach ($selected_plugins as $selected_plugin) {
	plugin_header($host, $selected_plugin);
	graphs_from_plugin($host, $selected_plugin);
}
echo '</div><! .graphs -->';

html_end();

?>