-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
32 lines (25 loc) · 914 Bytes
/
index.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
<?php
include_once 'conf/common.inc.php';
include_once 'inc/collectd.inc.php';
require_once 'inc/html.inc.php';
html_start();
$h = array();
# show all categorized hosts
if (is_array($CONFIG['cat'])) {
foreach($CONFIG['cat'] as $cat => $hosts) {
printf("<h2><a href=\"%shost.php?h=%s\">%s</a></h2>\n", $CONFIG['weburl'], implode(',', $hosts), $cat);
host_summary($cat, $hosts);
$h = array_merge($h, $hosts);
}
}
# search for uncategorized hosts
if(!$chosts = collectd_hosts())
printf('<p class="alert alert-error">Error: No collectd hosts found in <em>%s</em></p>', $CONFIG['datadir']);
if(!empty($chosts))
$uhosts = array_diff($chosts, $h);
# show all uncategorized hosts
if ($uhosts) {
echo "<h2>Uncategorized</h2>\n";
host_summary(NULL, $uhosts);
}
html_end();