$hosts) { if(is_array($hosts)) { host_summary($cat, $hosts); $h = array_merge($h, $hosts); } else { // Asume regexp $regexp = $hosts; $ahosts = collectd_hosts(); $rhosts = array(); foreach($ahosts as $host) { if(preg_match($regexp, $host)) { array_push($rhosts, $host); } } host_summary($cat, $rhosts); $h = array_merge($h, $rhosts); } } } # search for uncategorized hosts if(!$chosts = collectd_hosts()) printf('

Error: No Collectd hosts found in %s

', $CONFIG['datadir']); $uhosts = array_diff($chosts, $h); # show all uncategorized hosts if ($uhosts) { host_summary('uncategorized', $uhosts); } if ($CONFIG['showtime']) { echo << jQuery(document).ready(function() { jQuery("time.timeago").timeago(); }); EOT; } html_end(true);