diff options
Diffstat (limited to 'index.php')
| -rw-r--r-- | index.php | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/index.php b/index.php new file mode 100644 index 0000000..f937bcc --- /dev/null +++ b/index.php | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | <?php | ||
| 2 | |||
| 3 | include_once 'conf/common.inc.php'; | ||
| 4 | include_once 'inc/collectd.inc.php'; | ||
| 5 | require_once 'inc/html.inc.php'; | ||
| 6 | |||
| 7 | html_start(); | ||
| 8 | |||
| 9 | $h = array(); | ||
| 10 | |||
| 11 | # show all categorized hosts | ||
| 12 | foreach($CONFIG['cat'] as $cat => $hosts) { | ||
| 13 | printf("<h1>%s</h1>\n", $cat); | ||
| 14 | host_summary($hosts); | ||
| 15 | $h = array_merge($h, $hosts); | ||
| 16 | } | ||
| 17 | |||
| 18 | # search for uncategorized hosts | ||
| 19 | $chosts = collectd_hosts(); | ||
| 20 | $uhosts = array_diff($chosts, $h); | ||
| 21 | |||
| 22 | # show all uncategorized hosts | ||
| 23 | if ($uhosts) { | ||
| 24 | echo "<h1>uncategorized</h1>\n"; | ||
| 25 | host_summary($uhosts); | ||
| 26 | } | ||
| 27 | |||
| 28 | html_end(); | ||
| 29 | |||
| 30 | ?> | ||
