', $statusFileState));
380 | print(sprintf('Status file last updated at %s', date(DATE_RFC2822, $statusFileMtime)));
381 | print("
\n");
382 |
383 | echo "\n";
388 | echo '';
389 | if(is_callable($nagliteHeading)) {
390 | $nagliteHeading();
391 | } elseif ($nagliteHeading) {
392 | echo '
'.$nagliteHeading.'
';
393 | }
394 |
395 | sectionHeader('hosts', $counter);
396 | if (!$showAddresses)
397 | $hostInfo = False;
398 | $addressColumn = empty($hostInfo)?'':'
Address | ';
399 |
400 | if ($counter['hosts']['down']) {
401 | echo "
";
402 | echo "| Host | $addressColumnStatus | Duration | Status Information |
";
403 | foreach($states['hosts']['down'] as $host) {
404 | $state = $nagios["host"][$host["current_state"]];
405 | echo "\n";
406 | if ($showAddresses) {
407 | $hostName = $host["host_name"];
408 | echo "| $hostName | {$hostInfo[$hostName]["address"]} | \n";
409 | } else {
410 | echo "{$host["host_name"]} | \n";
411 | }
412 | echo "{$state} | \n";
413 | echo "".duration($host["last_state_change"])." | \n";
414 | print(sprintf("%s | \n", htmlspecialchars($host['plugin_output'])));
415 | echo "
\n";
416 | }
417 | echo "
";
418 | } else {
419 | echo "
ALL MONITORED HOSTS UP
\n";
420 | }
421 |
422 | foreach(array('unreachable', 'acknowledged', 'pending', 'notification') as $type) {
423 | if ($counter['hosts'][$type]) {
424 | print(sprintf('
%s: %s
', $type, ucfirst($type), implode(', ', $states['hosts'][$type])));
425 | }
426 | }
427 |
428 | sectionHeader('services', $counter);
429 |
430 | if ($counter['services']['warning'] || $counter['services']['critical'] || $counter['services']['unknown']) {
431 | serviceTable($nagios, $states['services'], $hostInfo, array('critical', 'warning', 'unknown'));
432 | } else {
433 | print("
ALL MONITORED SERVICES OK
\n");
434 | }
435 |
436 | foreach(array('acknowledged', 'notification', 'pending') as $type) {
437 | if ($counter['services'][$type]) {
438 | print(sprintf('
%s
', ucfirst($type)));
439 | print('
');
440 | serviceTable($nagios, $states['services'], $hostInfo, array($type), $type);
441 | print('
');
442 | }
443 | }
444 |
445 | if($enableFortune === true) {
446 | echo "
";
447 | print(shell_exec($fortunePath));
448 | echo "
";
449 | }
450 |
451 | print("\n");
452 | print("\n");
453 |
--------------------------------------------------------------------------------