', "\n"; ?> Nagios status getHosts(); echo ''; echo ''; $hosts = $op->getHosts(); knatsort($hosts); foreach ($hosts as $hn => $host) { echo ''; $first = true; foreach ($host['services'] as $sn => $service) { if ($first) { $first = false; } else { echo ''; } $services = $sh[$hn]['services'][$sn]; $status = translateStatus($services['current_state']); $prefix = $host['host_name'] . '_' . str_replace(' ', '_', $service['service_description']) . '_'; echo ''; echo ''; echo formatDate($services['last_check'], false, $prefix . 'last'); echo formatDate($services['next_check'], true, $prefix . 'next'); echo ''; echo ''; } } echo '
HostServiceStatusLast checkNext checkComment
', $host['alias'], '
', $service['service_description'], '', $status, '', trunc($services['plugin_output']), '
'; ?>