Merge branch 'feature/tactical-overview-3782' into feature/master-1

This commit is contained in:
Thomas Gelf 2014-03-04 10:26:51 +00:00
commit c2213e7b71
9 changed files with 1625 additions and 32 deletions

View File

@ -0,0 +1,144 @@
<?php
// {{{ICINGA_LICENSE_HEADER}}}
// {{{ICINGA_LICENSE_HEADER}}}
use Icinga\Module\Monitoring\Controller as MonitoringController;
use Icinga\Module\Monitoring\DataView\StatusSummary;
class Monitoring_TacticalController extends MonitoringController
{
public function indexAction()
{
$this->view->statusSummary = StatusSummary::fromRequest(
$this->_request,
array(
'hosts_up',
'hosts_up_not_checked',
'hosts_pending',
'hosts_pending_not_checked',
'hosts_down',
'hosts_down_handled',
'hosts_down_unhandled',
'hosts_down_handled_active',
'hosts_down_handled_passive',
'hosts_down_handled_not_checked',
'hosts_down_unhandled_active',
'hosts_down_unhandled_passive',
'hosts_down_unhandled_not_checked',
'hosts_unreachable',
'hosts_unreachable_handled',
'hosts_unreachable_unhandled',
'hosts_unreachable_handled_active',
'hosts_unreachable_handled_passive',
'hosts_unreachable_handled_not_checked',
'hosts_unreachable_unhandled_active',
'hosts_unreachable_unhandled_passive',
'hosts_unreachable_unhandled_not_checked',
'services_ok_on_up_hosts',
'services_ok_not_checked_on_up_hosts',
'services_pending_on_up_hosts',
'services_pending_not_checked_on_up_hosts',
'services_warning_handled_active_on_up_hosts',
'services_warning_handled_passive_on_up_hosts',
'services_warning_handled_not_checked_on_up_hosts',
'services_warning_unhandled_active_on_up_hosts',
'services_warning_unhandled_passive_on_up_hosts',
'services_warning_unhandled_not_checked_on_up_hosts',
'services_critical_handled_active_on_up_hosts',
'services_critical_handled_passive_on_up_hosts',
'services_critical_handled_not_checked_on_up_hosts',
'services_critical_unhandled_active_on_up_hosts',
'services_critical_unhandled_passive_on_up_hosts',
'services_critical_unhandled_not_checked_on_up_hosts',
'services_unknown_handled_active_on_up_hosts',
'services_unknown_handled_passive_on_up_hosts',
'services_unknown_handled_not_checked_on_up_hosts',
'services_unknown_unhandled_active_on_up_hosts',
'services_unknown_unhandled_passive_on_up_hosts',
'services_unknown_unhandled_not_checked_on_up_hosts',
'services_ok_on_down_hosts',
'services_ok_not_checked_on_down_hosts',
'services_pending_on_down_hosts',
'services_pending_not_checked_on_down_hosts',
'services_warning_handled_active_on_down_hosts',
'services_warning_handled_passive_on_down_hosts',
'services_warning_handled_not_checked_on_down_hosts',
'services_warning_unhandled_active_on_down_hosts',
'services_warning_unhandled_passive_on_down_hosts',
'services_warning_unhandled_not_checked_on_down_hosts',
'services_critical_handled_active_on_down_hosts',
'services_critical_handled_passive_on_down_hosts',
'services_critical_handled_not_checked_on_down_hosts',
'services_critical_unhandled_active_on_down_hosts',
'services_critical_unhandled_passive_on_down_hosts',
'services_critical_unhandled_not_checked_on_down_hosts',
'services_unknown_handled_active_on_down_hosts',
'services_unknown_handled_passive_on_down_hosts',
'services_unknown_handled_not_checked_on_down_hosts',
'services_unknown_unhandled_active_on_down_hosts',
'services_unknown_unhandled_passive_on_down_hosts',
'services_unknown_unhandled_not_checked_on_down_hosts',
'services_ok_on_unreachable_hosts',
'services_ok_not_checked_on_unreachable_hosts',
'services_pending_on_unreachable_hosts',
'services_pending_not_checked_on_unreachable_hosts',
'services_warning_handled_active_on_unreachable_hosts',
'services_warning_handled_passive_on_unreachable_hosts',
'services_warning_handled_not_checked_on_unreachable_hosts',
'services_warning_unhandled_active_on_unreachable_hosts',
'services_warning_unhandled_passive_on_unreachable_hosts',
'services_warning_unhandled_not_checked_on_unreachable_hosts',
'services_critical_handled_active_on_unreachable_hosts',
'services_critical_handled_passive_on_unreachable_hosts',
'services_critical_handled_not_checked_on_unreachable_hosts',
'services_critical_unhandled_active_on_unreachable_hosts',
'services_critical_unhandled_passive_on_unreachable_hosts',
'services_critical_unhandled_not_checked_on_unreachable_hosts',
'services_unknown_handled_active_on_unreachable_hosts',
'services_unknown_handled_passive_on_unreachable_hosts',
'services_unknown_handled_not_checked_on_unreachable_hosts',
'services_unknown_unhandled_active_on_unreachable_hosts',
'services_unknown_unhandled_passive_on_unreachable_hosts',
'services_unknown_unhandled_not_checked_on_unreachable_hosts',
'services_ok_on_pending_hosts',
'services_ok_not_checked_on_pending_hosts',
'services_pending_on_pending_hosts',
'services_pending_not_checked_on_pending_hosts',
'services_warning_handled_active_on_pending_hosts',
'services_warning_handled_passive_on_pending_hosts',
'services_warning_handled_not_checked_on_pending_hosts',
'services_warning_unhandled_active_on_pending_hosts',
'services_warning_unhandled_passive_on_pending_hosts',
'services_warning_unhandled_not_checked_on_pending_hosts',
'services_critical_handled_active_on_pending_hosts',
'services_critical_handled_passive_on_pending_hosts',
'services_critical_handled_not_checked_on_pending_hosts',
'services_critical_unhandled_active_on_pending_hosts',
'services_critical_unhandled_passive_on_pending_hosts',
'services_critical_unhandled_not_checked_on_pending_hosts',
'services_unknown_handled_active_on_pending_hosts',
'services_unknown_handled_passive_on_pending_hosts',
'services_unknown_handled_not_checked_on_pending_hosts',
'services_unknown_unhandled_active_on_pending_hosts',
'services_unknown_unhandled_passive_on_pending_hosts',
'services_unknown_unhandled_not_checked_on_pending_hosts',
'hosts_active',
'hosts_passive',
'hosts_not_checked',
'services_active',
'services_passive',
'services_not_checked',
'hosts_processing_event_handlers',
'services_processing_event_handlers',
'hosts_triggering_notifications',
'services_triggering_notifications',
'hosts_with_flap_detection',
'services_with_flap_detection',
'hosts_flapping',
'services_flapping'
)
)->getQuery()->fetchRow();
}
}

View File

@ -0,0 +1,76 @@
<span class="state">
<table>
<thead>
<th>Host checks</th>
<th>Service checks</th>
</thead>
<tbody>
<tr>
<td>
<?php if ($this->statusSummary->hosts_active): ?>
<span class="state active">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_active_checks_enabled' => 1)
); ?>">
<?= $this->statusSummary->hosts_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_passive): ?>
<span class="state passive">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 1)
); ?>">
<?= $this->statusSummary->hosts_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_not_checked): ?>
<span class="state not_checked">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_active_checks_enabled' => 0, 'host_passive_checks_enabled' => 0)
); ?>">
<?= $this->statusSummary->hosts_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</td>
<td>
<?php if ($this->statusSummary->services_active): ?>
<span class="state active">
<a href="<?= $this->href(
'monitoring/list/services',
array('service_active_checks_enabled' => 1)
); ?>">
<?= $this->statusSummary->services_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->services_passive): ?>
<span class="state passive">
<a href="<?= $this->href(
'monitoring/list/services',
array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 1)
); ?>">
<?= $this->statusSummary->services_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->services_not_checked): ?>
<span class="state not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array('service_active_checks_enabled' => 0, 'service_passive_checks_enabled' => 0)
); ?>">
<?= $this->statusSummary->services_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</td>
</tr>
</tbody>
</table>
</span>

View File

@ -0,0 +1,182 @@
<?php
$summary = $this->statusSummary;
$total_services = $summary->services_active + $summary->services_passive + $summary->services_not_checked;
$total_hosts = $summary->hosts_active + $summary->hosts_passive + $summary->hosts_not_checked;
$services_without_flap_detection = $total_services - $summary->services_with_flap_detection;
$hosts_without_flap_detection = $total_hosts - $summary->hosts_with_flap_detection;
$non_flapping_services = $total_services - $summary->services_flapping;
$non_flapping_hosts = $total_hosts - $summary->hosts_flapping;
$hosts_not_triggering_notifications = $total_hosts - $summary->hosts_triggering_notifications;
$services_not_triggering_notifications = $total_services - $summary->services_triggering_notifications;
$hosts_not_processing_event_handlers = $total_hosts - $summary->hosts_processing_event_handlers;
$services_not_processing_event_handlers = $total_services - $summary->services_processing_event_handlers;
?>
<span class="state">
<table>
<caption>Monitoring features</caption>
<thead>
<th>Hosts</th>
<th>Services</th>
</thead>
<tbody>
<tr>
<td colspan="2">
<span class="state subtitle">Flap detection</span>
</td>
</tr>
<tr>
<td>
<span class="state flap_detection">
<?php if ($hosts_without_flap_detection): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_flap_detection_enabled' => 0)
); ?>">
<?= $hosts_without_flap_detection; ?> hosts disabled
</a>
<?php else: ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_flap_detection_enabled' => 1)
); ?>">
All hosts enabled
</a>
<?php endif ?>
<?php if ($summary->hosts_flapping): ?>
<span class="state flap_detection flapping">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_is_flapping' => 1)
); ?>">
<?= $summary->hosts_flapping; ?> hosts flapping
</a>
</span>
<?php endif ?>
</span>
</td>
<td>
<span class="state flap_detection">
<?php if ($services_without_flap_detection): ?>
<a href="<?= $this->href(
'monitoring/list/services',
array('service_flap_detection_enabled' => 0)
); ?>">
<?= $services_without_flap_detection; ?> services disabled
</a>
<?php else: ?>
<a href="<?= $this->href(
'monitoring/list/services',
array('service_flap_detection_enabled' => 1)
); ?>">
All services enabled
</a>
<?php endif ?>
<?php if ($summary->services_flapping): ?>
<span class="state flap_detection flapping">
<a href="<?= $this->href(
'monitoring/list/services',
array('service_is_flapping' => 1)
); ?>">
<?= $summary->services_flapping; ?> services flapping
</a>
</span>
<?php endif ?>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<span class="state subtitle">Notifications</span>
</td>
</tr>
<tr>
<td>
<span class="state notifications">
<?php if ($hosts_not_triggering_notifications): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_notifications_enabled' => 0)
); ?>">
<?= $hosts_not_triggering_notifications; ?> hosts disabled
</a>
<?php else: ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_notifications_enabled' => 1)
); ?>">
All hosts enabled
</a>
<?php endif ?>
</span>
</td>
<td>
<span class="state notifications">
<?php if ($services_not_triggering_notifications): ?>
<a href="<?= $this->href(
'monitoring/list/services',
array('service_notifications_enabled' => 0)
); ?>">
<?= $services_not_triggering_notifications; ?> hosts disabled
</a>
<?php else: ?>
<a href="<?= $this->href(
'monitoring/list/services',
array('service_notifications_enabled' => 1)
); ?>">
All services enabled
</a>
<?php endif ?>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<span class="state subtitle">Event handlers</span>
</td>
</tr>
<tr>
<td>
<span class="state eventhandlers">
<?php if ($hosts_not_processing_event_handlers): ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_event_handler_enabled' => 0)
); ?>">
<?= $hosts_not_processing_event_handlers; ?> hosts disabled
</a>
<?php else: ?>
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_event_handler_enabled' => 1)
); ?>">
All hosts enabled
</a>
<?php endif ?>
</span>
</td>
<td>
<span class="state notifications">
<?php if ($services_not_processing_event_handlers): ?>
<a href="<?= $this->href(
'monitoring/list/services',
array('service_event_handler_enabled' => 0)
); ?>">
<?= $services_not_processing_event_handlers; ?> hosts disabled
</a>
<?php else: ?>
<a href="<?= $this->href(
'monitoring/list/services',
array('service_event_handler_enabled' => 1)
); ?>">
All services enabled
</a>
<?php endif ?>
</span>
</td>
</tr>
</tbody>
</table>
</span>

View File

@ -0,0 +1,437 @@
<?php
$services_warning_handled = $services_warning_handled_active + $services_warning_handled_passive + $services_warning_handled_not_checked;
$services_warning_unhandled = $services_warning_unhandled_active + $services_warning_unhandled_passive + $services_warning_unhandled_not_checked;
$services_critical_handled = $services_critical_handled_active + $services_critical_handled_passive + $services_critical_handled_not_checked;
$services_critical_unhandled = $services_critical_unhandled_active + $services_critical_unhandled_passive + $services_critical_unhandled_not_checked;
$services_unknown_handled = $services_unknown_handled_active + $services_unknown_handled_passive + $services_unknown_handled_not_checked;
$services_unknown_unhandled = $services_unknown_unhandled_active + $services_unknown_unhandled_passive + $services_unknown_unhandled_not_checked;
$services_warning = $services_warning_handled + $services_warning_unhandled;
$services_critical = $services_critical_handled + $services_critical_unhandled;
$services_unknown = $services_unknown_handled + $services_unknown_unhandled;
?>
<?php if ($services_critical): ?>
<span class="state critical">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 2)
); ?>">
<?= $services_critical; ?> CRITICAL
</a>
<?php if ($services_critical_unhandled): ?>
<span class="state critical unhandled">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 2, 'service_handled' => 0)
); ?>">
<?= $services_critical_unhandled; ?> unhandled
</a>
<?php if ($services_critical_unhandled_active): ?>
<span class="state critical unhandled active">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 2,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 1
)
); ?>">
<?= $services_critical_unhandled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($services_critical_unhandled_passive): ?>
<span class="state critical unhandled passive">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 2,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1
)
); ?>">
<?= $services_critical_unhandled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($services_critical_unhandled_not_checked): ?>
<span class="state critical unhandled not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 2,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0
)
); ?>">
<?= $services_critical_unhandled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($services_critical_handled): ?>
<span class="state critical handled">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 2, 'service_handled' => 1)
); ?>">
<?= $services_critical_handled; ?> handled
</a>
<?php if ($services_critical_handled_active): ?>
<span class="state critical handled active">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 2,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 1
)
); ?>">
<?= $services_critical_handled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($services_critical_handled_passive): ?>
<span class="state critical handled passive">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 2,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1
)
); ?>">
<?= $services_critical_handled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($services_critical_handled_not_checked): ?>
<span class="state critical handled not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 2,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0
)
); ?>">
<?= $services_critical_handled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($services_warning): ?>
<span class="state warning">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 1)
); ?>">
<?= $services_warning; ?> WARNING
</a>
<?php if ($services_warning_unhandled): ?>
<span class="state warning unhandled">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 1, 'service_handled' => 0)
); ?>">
<?= $services_warning_unhandled; ?> unhandled
</a>
<?php if ($services_warning_unhandled_active): ?>
<span class="state warning unhandled active">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 1,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 1
)
); ?>">
<?= $services_warning_unhandled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($services_warning_unhandled_passive): ?>
<span class="state warning unhandled passive">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 1,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1
)
); ?>">
<?= $services_warning_unhandled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($services_warning_unhandled_not_checked): ?>
<span class="state warning unhandled not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 1,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0
)
); ?>">
<?= $services_warning_unhandled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($services_warning_handled): ?>
<span class="state warning handled">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 1, 'service_handled' => 1)
); ?>">
<?= $services_warning_handled; ?> handled
</a>
<?php if ($services_warning_handled_active): ?>
<span class="state warning handled active">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 1,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 1
)
); ?>">
<?= $services_warning_handled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($services_warning_handled_passive): ?>
<span class="state warning handled passive">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 1,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1
)
); ?>">
<?= $services_warning_handled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($services_warning_handled_not_checked): ?>
<span class="state warning handled not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 1,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0
)
); ?>">
<?= $services_warning_handled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($services_unknown): ?>
<span class="state unknown">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 3)
); ?>">
<?= $services_unknown; ?> UNKNOWN
</a>
<?php if ($services_unknown_unhandled): ?>
<span class="state unknown unhandled">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 3, 'service_handled' => 0)
); ?>">
<?= $services_unknown_unhandled; ?> unhandled
</a>
<?php if ($services_unknown_unhandled_active): ?>
<span class="state unknown unhandled active">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 3,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 1
)
); ?>">
<?= $services_unknown_unhandled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($services_unknown_unhandled_passive): ?>
<span class="state unknown unhandled passive">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 3,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1
)
); ?>">
<?= $services_unknown_unhandled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($services_unknown_unhandled_not_checked): ?>
<span class="state unknown unhandled not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 3,
'service_handled' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0
)
); ?>">
<?= $services_unknown_unhandled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($services_unknown_handled): ?>
<span class="state unknown handled">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 3, 'service_handled' => 1)
); ?>">
<?= $services_unknown_handled; ?> handled
</a>
<?php if ($services_unknown_handled_active): ?>
<span class="state unknown handled not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 3,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 1,
)
); ?>">
<?= $services_unknown_handled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($services_unknown_handled_passive): ?>
<span class="state unknown handled not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 3,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 1
)
); ?>">
<?= $services_unknown_handled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($services_unknown_handled_not_checked): ?>
<span class="state unknown handled not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 3,
'service_handled' => 1,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0
)
); ?>">
<?= $services_unknown_handled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($services_ok): ?>
<span class="state ok">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 0)
); ?>">
<?= $services_ok; ?> OK
</a>
<?php if ($services_ok_not_checked): ?>
<span class="state ok not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 0,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0
)
); ?>">
<?= $services_ok_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($services_pending): ?>
<span class="state pending">
<a href="<?= $this->href(
'monitoring/list/services',
array('host_state' => $hostState, 'service_state' => 99)
); ?>">
<?= $services_pending; ?> PENDING
</a>
<?php if ($services_pending_not_checked): ?>
<span class="state pending not_checked">
<a href="<?= $this->href(
'monitoring/list/services',
array(
'service_state' => 99,
'host_state' => $hostState,
'service_active_checks_enabled' => 0,
'service_passive_checks_enabled' => 0
)
); ?>">
<?= $services_pending_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>

View File

@ -0,0 +1,431 @@
<span class="state">
<table>
<caption>Status Summary</caption>
<thead>
<th>Hosts</th>
<th>Services</th>
</thead>
<tbody>
<?php if ($this->statusSummary->hosts_up): ?>
<tr>
<td>
<span class="state up">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 0)
); ?>">
<?= $this->statusSummary->hosts_up; ?> UP
</a>
<?php if ($this->statusSummary->hosts_up_not_checked): ?>
<span class="state up not_checked">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 0,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?= $this->statusSummary->hosts_up_not_checked; ?> disabled
</a>
</span>
<?php endif ?>
</span>
</td>
<td>
<?= $this->partial(
'tactical/components/parts/servicestatesummarybyhoststate.phtml',
array(
'hostState' => 0,
'services_ok' => $this->statusSummary->services_ok_on_up_hosts,
'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_up_hosts,
'services_pending' => $this->statusSummary->services_pending_on_up_hosts,
'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_up_hosts,
'services_warning_handled_active' => $this->statusSummary->services_warning_handled_active_on_up_hosts,
'services_warning_handled_passive' => $this->statusSummary->services_warning_handled_passive_on_up_hosts,
'services_warning_handled_not_checked' => $this->statusSummary->services_warning_handled_not_checked_on_up_hosts,
'services_warning_unhandled_active' => $this->statusSummary->services_warning_unhandled_active_on_up_hosts,
'services_warning_unhandled_passive' => $this->statusSummary->services_warning_unhandled_passive_on_up_hosts,
'services_warning_unhandled_not_checked' => $this->statusSummary->services_warning_unhandled_not_checked_on_up_hosts,
'services_critical_handled_active' => $this->statusSummary->services_critical_handled_active_on_up_hosts,
'services_critical_handled_passive' => $this->statusSummary->services_critical_handled_passive_on_up_hosts,
'services_critical_handled_not_checked' => $this->statusSummary->services_critical_handled_not_checked_on_up_hosts,
'services_critical_unhandled_active' => $this->statusSummary->services_critical_unhandled_active_on_up_hosts,
'services_critical_unhandled_passive' => $this->statusSummary->services_critical_unhandled_passive_on_up_hosts,
'services_critical_unhandled_not_checked' => $this->statusSummary->services_critical_unhandled_not_checked_on_up_hosts,
'services_unknown_handled_active' => $this->statusSummary->services_unknown_handled_active_on_up_hosts,
'services_unknown_handled_passive' => $this->statusSummary->services_unknown_handled_passive_on_up_hosts,
'services_unknown_handled_not_checked' => $this->statusSummary->services_unknown_handled_not_checked_on_up_hosts,
'services_unknown_unhandled_active' => $this->statusSummary->services_unknown_unhandled_active_on_up_hosts,
'services_unknown_unhandled_passive' => $this->statusSummary->services_unknown_unhandled_passive_on_up_hosts,
'services_unknown_unhandled_not_checked' => $this->statusSummary->services_unknown_unhandled_not_checked_on_up_hosts
)
); ?>
</td>
</tr>
<?php endif ?>
<?php if ($this->statusSummary->hosts_pending): ?>
<tr>
<td>
<span class="state pending">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 99)
); ?>">
<?= $this->statusSummary->hosts_pending; ?> PENDING
</a>
<?php if ($this->statusSummary->hosts_pending_not_checked): ?>
<span class="state pending not_checked">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 99,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?= $this->statusSummary->hosts_pending_not_checked; ?> disabled
</a>
</span>
<?php endif ?>
</span>
</td>
<td>
<?= $this->partial(
'tactical/components/parts/servicestatesummarybyhoststate.phtml',
array(
'hostState' => 99,
'services_ok' => $this->statusSummary->services_ok_on_pending_hosts,
'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_pending_hosts,
'services_pending' => $this->statusSummary->services_pending_on_pending_hosts,
'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_pending_hosts,
'services_warning_handled_active' => $this->statusSummary->services_warning_handled_active_on_pending_hosts,
'services_warning_handled_passive' => $this->statusSummary->services_warning_handled_passive_on_pending_hosts,
'services_warning_handled_not_checked' => $this->statusSummary->services_warning_handled_not_checked_on_pending_hosts,
'services_warning_unhandled_active' => $this->statusSummary->services_warning_unhandled_active_on_pending_hosts,
'services_warning_unhandled_passive' => $this->statusSummary->services_warning_unhandled_passive_on_pending_hosts,
'services_warning_unhandled_not_checked' => $this->statusSummary->services_warning_unhandled_not_checked_on_pending_hosts,
'services_critical_handled_active' => $this->statusSummary->services_critical_handled_active_on_pending_hosts,
'services_critical_handled_passive' => $this->statusSummary->services_critical_handled_passive_on_pending_hosts,
'services_critical_handled_not_checked' => $this->statusSummary->services_critical_handled_not_checked_on_pending_hosts,
'services_critical_unhandled_active' => $this->statusSummary->services_critical_unhandled_active_on_pending_hosts,
'services_critical_unhandled_passive' => $this->statusSummary->services_critical_unhandled_passive_on_pending_hosts,
'services_critical_unhandled_not_checked' => $this->statusSummary->services_critical_unhandled_not_checked_on_pending_hosts,
'services_unknown_handled_active' => $this->statusSummary->services_unknown_handled_active_on_pending_hosts,
'services_unknown_handled_passive' => $this->statusSummary->services_unknown_handled_passive_on_pending_hosts,
'services_unknown_handled_not_checked' => $this->statusSummary->services_unknown_handled_not_checked_on_pending_hosts,
'services_unknown_unhandled_active' => $this->statusSummary->services_unknown_unhandled_active_on_pending_hosts,
'services_unknown_unhandled_passive' => $this->statusSummary->services_unknown_unhandled_passive_on_pending_hosts,
'services_unknown_unhandled_not_checked' => $this->statusSummary->services_unknown_unhandled_not_checked_on_pending_hosts
)
); ?>
</td>
</tr>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down): ?>
<tr>
<td>
<span class="state down">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 1)
); ?>">
<?= $this->statusSummary->hosts_down; ?> DOWN
</a>
<?php if ($this->statusSummary->hosts_down_unhandled): ?>
<span class="state down unhandled">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 1, 'host_handled' => 0)
); ?>">
<?= $this->statusSummary->hosts_down_unhandled; ?> unhandled
</a>
<?php if ($this->statusSummary->hosts_down_unhandled_active): ?>
<span class="state down unhandled active">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 1,
'host_handled' => 0,
'host_active_checks_enabled' => 1
)
); ?>">
<?= $this->statusSummary->hosts_down_unhandled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down_unhandled_passive): ?>
<span class="state down unhandled passive">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 1,
'host_handled' => 0,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 1
)
); ?>">
<?= $this->statusSummary->hosts_down_unhandled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down_unhandled_not_checked): ?>
<span class="state down unhandled not_checked">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 1,
'host_handled' => 0,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?= $this->statusSummary->hosts_down_unhandled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down_handled): ?>
<span class="state down handled">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 1, 'host_handled' => 1)
); ?>">
<?= $this->statusSummary->hosts_down_handled; ?> handled
</a>
<?php if ($this->statusSummary->hosts_down_handled_active): ?>
<span class="state down handled active">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 1,
'host_handled' => 1,
'host_active_checks_enabled' => 1
)
); ?>">
<?= $this->statusSummary->hosts_down_handled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down_handled_passive): ?>
<span class="state down handled passive">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 1,
'host_handled' => 1,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 1
)
); ?>">
<?= $this->statusSummary->hosts_down_handled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_down_handled_not_checked): ?>
<span class="state down handled not_checked">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 1,
'host_handled' => 1,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?= $this->statusSummary->hosts_down_handled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
</span>
</td>
<td>
<?= $this->partial(
'tactical/components/parts/servicestatesummarybyhoststate.phtml',
array(
'hostState' => 1,
'services_ok' => $this->statusSummary->services_ok_on_down_hosts,
'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_down_hosts,
'services_pending' => $this->statusSummary->services_pending_on_down_hosts,
'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_down_hosts,
'services_warning_handled_active' => $this->statusSummary->services_warning_handled_active_on_down_hosts,
'services_warning_handled_passive' => $this->statusSummary->services_warning_handled_passive_on_down_hosts,
'services_warning_handled_not_checked' => $this->statusSummary->services_warning_handled_not_checked_on_down_hosts,
'services_warning_unhandled_active' => $this->statusSummary->services_warning_unhandled_active_on_down_hosts,
'services_warning_unhandled_passive' => $this->statusSummary->services_warning_unhandled_passive_on_down_hosts,
'services_warning_unhandled_not_checked' => $this->statusSummary->services_warning_unhandled_not_checked_on_down_hosts,
'services_critical_handled_active' => $this->statusSummary->services_critical_handled_active_on_down_hosts,
'services_critical_handled_passive' => $this->statusSummary->services_critical_handled_passive_on_down_hosts,
'services_critical_handled_not_checked' => $this->statusSummary->services_critical_handled_not_checked_on_down_hosts,
'services_critical_unhandled_active' => $this->statusSummary->services_critical_unhandled_active_on_down_hosts,
'services_critical_unhandled_passive' => $this->statusSummary->services_critical_unhandled_passive_on_down_hosts,
'services_critical_unhandled_not_checked' => $this->statusSummary->services_critical_unhandled_not_checked_on_down_hosts,
'services_unknown_handled_active' => $this->statusSummary->services_unknown_handled_active_on_down_hosts,
'services_unknown_handled_passive' => $this->statusSummary->services_unknown_handled_passive_on_down_hosts,
'services_unknown_handled_not_checked' => $this->statusSummary->services_unknown_handled_not_checked_on_down_hosts,
'services_unknown_unhandled_active' => $this->statusSummary->services_unknown_unhandled_active_on_down_hosts,
'services_unknown_unhandled_passive' => $this->statusSummary->services_unknown_unhandled_passive_on_down_hosts,
'services_unknown_unhandled_not_checked' => $this->statusSummary->services_unknown_unhandled_not_checked_on_down_hosts
)
); ?>
</td>
</tr>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable): ?>
<tr>
<td>
<span class="state unreachable">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 2)
); ?>">
<?= $this->statusSummary->hosts_unreachable; ?> UNREACHABLE
</a>
<?php if ($this->statusSummary->hosts_unreachable_unhandled): ?>
<span class="state unreachable unhandled">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 2, 'host_handled' => 0)
); ?>">
<?= $this->statusSummary->hosts_unreachable_unhandled; ?> unhandled
</a>
<?php if ($this->statusSummary->hosts_unreachable_unhandled_active): ?>
<span class="state unreachable unhandled active">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 2,
'host_handled' => 0,
'host_active_checks_enabled' => 1
)
); ?>">
<?= $this->statusSummary->hosts_unreachable_unhandled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_unhandled_passive): ?>
<span class="state unreachable unhandled passive">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 2,
'host_handled' => 0,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 1
)
); ?>">
<?= $this->statusSummary->hosts_unreachable_unhandled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_unhandled_not_checked): ?>
<span class="state unreachable unhandled not_checked">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 2,
'host_handled' => 0,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?= $this->statusSummary->hosts_unreachable_unhandled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_handled): ?>
<span class="state unreachable handled">
<a href="<?= $this->href(
'monitoring/list/hosts',
array('host_state' => 2, 'host_handled' => 1)
); ?>">
<?= $this->statusSummary->hosts_unreachable_handled; ?> handled
</a>
<?php if ($this->statusSummary->hosts_unreachable_handled_active): ?>
<span class="state unreachable handled active">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 2,
'host_handled' => 1,
'host_active_checks_enabled' => 1
)
); ?>">
<?= $this->statusSummary->hosts_unreachable_handled_active; ?> Active
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_handled_passive): ?>
<span class="state unreachable handled passive">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 2,
'host_handled' => 1,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 1
)
); ?>">
<?= $this->statusSummary->hosts_unreachable_handled_passive; ?> Passive
</a>
</span>
<?php endif ?>
<?php if ($this->statusSummary->hosts_unreachable_handled_not_checked): ?>
<span class="state unreachable handled not_checked">
<a href="<?= $this->href(
'monitoring/list/hosts',
array(
'host_state' => 2,
'host_handled' => 1,
'host_active_checks_enabled' => 0,
'host_passive_checks_enabled' => 0
)
); ?>">
<?= $this->statusSummary->hosts_unreachable_handled_not_checked; ?> Not checked
</a>
</span>
<?php endif ?>
</span>
<?php endif ?>
</span>
</td>
<td>
<?= $this->partial(
'tactical/components/parts/servicestatesummarybyhoststate.phtml',
array(
'hostState' => 2,
'services_ok' => $this->statusSummary->services_ok_on_unreachable_hosts,
'services_ok_not_checked' => $this->statusSummary->services_ok_not_checked_on_unreachable_hosts,
'services_pending' => $this->statusSummary->services_pending_on_unreachable_hosts,
'services_pending_not_checked' => $this->statusSummary->services_pending_not_checked_on_unreachable_hosts,
'services_warning_handled_active' => $this->statusSummary->services_warning_handled_active_on_unreachable_hosts,
'services_warning_handled_passive' => $this->statusSummary->services_warning_handled_passive_on_unreachable_hosts,
'services_warning_handled_not_checked' => $this->statusSummary->services_warning_handled_not_checked_on_unreachable_hosts,
'services_warning_unhandled_active' => $this->statusSummary->services_warning_unhandled_active_on_unreachable_hosts,
'services_warning_unhandled_passive' => $this->statusSummary->services_warning_unhandled_passive_on_unreachable_hosts,
'services_warning_unhandled_not_checked' => $this->statusSummary->services_warning_unhandled_not_checked_on_unreachable_hosts,
'services_critical_handled_active' => $this->statusSummary->services_critical_handled_active_on_unreachable_hosts,
'services_critical_handled_passive' => $this->statusSummary->services_critical_handled_passive_on_unreachable_hosts,
'services_critical_handled_not_checked' => $this->statusSummary->services_critical_handled_not_checked_on_unreachable_hosts,
'services_critical_unhandled_active' => $this->statusSummary->services_critical_unhandled_active_on_unreachable_hosts,
'services_critical_unhandled_passive' => $this->statusSummary->services_critical_unhandled_passive_on_unreachable_hosts,
'services_critical_unhandled_not_checked' => $this->statusSummary->services_critical_unhandled_not_checked_on_unreachable_hosts,
'services_unknown_handled_active' => $this->statusSummary->services_unknown_handled_active_on_unreachable_hosts,
'services_unknown_handled_passive' => $this->statusSummary->services_unknown_handled_passive_on_unreachable_hosts,
'services_unknown_handled_not_checked' => $this->statusSummary->services_unknown_handled_not_checked_on_unreachable_hosts,
'services_unknown_unhandled_active' => $this->statusSummary->services_unknown_unhandled_active_on_unreachable_hosts,
'services_unknown_unhandled_passive' => $this->statusSummary->services_unknown_unhandled_passive_on_unreachable_hosts,
'services_unknown_unhandled_not_checked' => $this->statusSummary->services_unknown_unhandled_not_checked_on_unreachable_hosts
)
); ?>
</td>
</tr>
<?php endif ?>
</tbody>
</table>
</span>

View File

@ -0,0 +1,7 @@
<div class="content">
<div class="summary" data-base-target="col2">
<?= $this->render('tactical/components/hostservicechecks.phtml'); ?>
<?= $this->render('tactical/components/monitoringfeatures.phtml'); ?>
<?= $this->render('tactical/components/statussummary.phtml'); ?>
</div>
</div>

View File

@ -35,23 +35,166 @@ use \Zend_Db_Select;
class StatusSummaryQuery extends IdoQuery
{
protected $columnMap = array(
'hoststatussummary' => array(
'hosts_up' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 THEN 1 ELSE 0 END)',
'hosts_unreachable_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)',
'hosts_unreachable_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
'hosts_down_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime != 0 THEN 1 ELSE 0 END)',
'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)'
'hoststatussummary' => array(
'hosts_up' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 THEN 1 ELSE 0 END)',
'hosts_up_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'hosts_pending' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 THEN 1 ELSE 0 END)',
'hosts_pending_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'hosts_down' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 THEN 1 ELSE 0 END)',
'hosts_down_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
'hosts_down_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
'hosts_down_handled_active' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'hosts_down_handled_passive' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'hosts_down_handled_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'hosts_down_unhandled_active' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'hosts_down_unhandled_passive' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'hosts_down_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'hosts_unreachable' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 THEN 1 ELSE 0 END)',
'hosts_unreachable_handled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime > 0 THEN 1 ELSE 0 END)',
'hosts_unreachable_unhandled' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 THEN 1 ELSE 0 END)',
'hosts_unreachable_handled_active' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'hosts_unreachable_handled_passive' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'hosts_unreachable_handled_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'hosts_unreachable_unhandled_active' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'hosts_unreachable_unhandled_passive' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'hosts_unreachable_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'hosts_active' => 'SUM(CASE WHEN object_type = \'host\' AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'hosts_passive' => 'SUM(CASE WHEN object_type = \'host\' AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'hosts_not_checked' => 'SUM(CASE WHEN object_type = \'host\' AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'hosts_processing_event_handlers' => 'SUM(CASE WHEN object_type = \'host\' AND is_processing_events = 1 THEN 1 ELSE 0 END)',
'hosts_triggering_notifications' => 'SUM(CASE WHEN object_type = \'host\' AND is_triggering_notifications = 1 THEN 1 ELSE 0 END)',
'hosts_with_flap_detection' => 'SUM(CASE WHEN object_type = \'host\' AND is_allowed_to_flap = 1 THEN 1 ELSE 0 END)',
'hosts_flapping' => 'SUM(CASE WHEN object_type = \'host\' AND is_flapping = 1 THEN 1 ELSE 0 END)'
),
'servicestatussummary' => array(
'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)',
'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)',
'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)',
'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)',
'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)'
'servicestatussummary' => array(
'services_ok' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 THEN 1 ELSE 0 END)',
'services_ok_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_pending' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 THEN 1 ELSE 0 END)',
'services_pending_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 THEN 1 ELSE 0 END)',
'services_warning_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
'services_warning_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)',
'services_warning_handled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_unhandled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 1 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 THEN 1 ELSE 0 END)',
'services_critical_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
'services_critical_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)',
'services_critical_handled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_unhandled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 2 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 THEN 1 ELSE 0 END)',
'services_unknown_handled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 THEN 1 ELSE 0 END)',
'services_unknown_unhandled' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 THEN 1 ELSE 0 END)',
'services_unknown_handled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_active' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_passive' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND state = 3 AND (acknowledged + in_downtime + COALESCE(host_state, 0)) = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_active' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_passive' => 'SUM(CASE WHEN object_type = \'service\' AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_not_checked' => 'SUM(CASE WHEN object_type = \'service\' AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_processing_event_handlers' => 'SUM(CASE WHEN object_type = \'service\' AND is_processing_events = 1 THEN 1 ELSE 0 END)',
'services_triggering_notifications' => 'SUM(CASE WHEN object_type = \'service\' AND is_triggering_notifications = 1 THEN 1 ELSE 0 END)',
'services_with_flap_detection' => 'SUM(CASE WHEN object_type = \'service\' AND is_allowed_to_flap = 1 THEN 1 ELSE 0 END)',
'services_flapping' => 'SUM(CASE WHEN object_type = \'service\' AND is_flapping = 1 THEN 1 ELSE 0 END)',
'services_ok_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 0 THEN 1 ELSE 0 END)',
'services_ok_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_pending_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 99 THEN 1 ELSE 0 END)',
'services_pending_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_handled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_unhandled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_handled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_unhandled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_handled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_active_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_passive_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_not_checked_on_up_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 0 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_ok_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 0 THEN 1 ELSE 0 END)',
'services_ok_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_pending_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 99 THEN 1 ELSE 0 END)',
'services_pending_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_handled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_unhandled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_handled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_unhandled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_handled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_active_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_passive_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_not_checked_on_down_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 1 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_ok_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 0 THEN 1 ELSE 0 END)',
'services_ok_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_pending_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 99 THEN 1 ELSE 0 END)',
'services_pending_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_handled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_unhandled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_handled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_unhandled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_handled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_active_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_passive_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_not_checked_on_unreachable_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 2 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_ok_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 0 THEN 1 ELSE 0 END)',
'services_ok_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_pending_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 99 THEN 1 ELSE 0 END)',
'services_pending_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 99 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_handled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_handled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_warning_unhandled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_warning_unhandled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 1 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_handled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_handled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_critical_unhandled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_critical_unhandled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 2 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_handled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime > 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_handled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime > 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_active_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_passive_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime = 0 AND is_passive_checked = 1 THEN 1 ELSE 0 END)',
'services_unknown_unhandled_not_checked_on_pending_hosts' => 'SUM(CASE WHEN object_type = \'service\' AND host_state = 99 AND state = 3 AND acknowledged + in_downtime = 0 AND is_active_checked = 0 AND is_passive_checked = 0 THEN 1 ELSE 0 END)'
)
);
@ -86,18 +229,30 @@ class StatusSummaryQuery extends IdoQuery
array()
);
$hosts->columns(array(
'state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END',
'acknowledged' => 'hs.problem_has_been_acknowledged',
'in_downtime' => 'CASE WHEN (hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END',
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END',
'object_type' => '(\'host\')'
'state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END',
'acknowledged' => 'hs.problem_has_been_acknowledged',
'in_downtime' => 'CASE WHEN (hs.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END',
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END',
'is_passive_checked' => 'CASE WHEN hs.active_checks_enabled = 0 AND hs.passive_checks_enabled = 1 THEN 1 ELSE 0 END',
'is_active_checked' => 'hs.active_checks_enabled',
'is_processing_events' => 'hs.event_handler_enabled',
'is_triggering_notifications' => 'hs.notifications_enabled',
'is_allowed_to_flap' => 'hs.flap_detection_enabled',
'is_flapping' => 'hs.is_flapping',
'object_type' => '(\'host\')'
));
$services->columns(array(
'state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE ss.current_state END',
'acknowledged' => 'ss.problem_has_been_acknowledged',
'in_downtime' => 'CASE WHEN (ss.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END',
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END',
'object_type' => '(\'service\')'
'state' => 'CASE WHEN ss.has_been_checked = 0 OR ss.has_been_checked IS NULL THEN 99 ELSE ss.current_state END',
'acknowledged' => 'ss.problem_has_been_acknowledged',
'in_downtime' => 'CASE WHEN (ss.scheduled_downtime_depth = 0) THEN 0 ELSE 1 END',
'host_state' => 'CASE WHEN hs.has_been_checked = 0 OR hs.has_been_checked IS NULL THEN 99 ELSE hs.current_state END',
'is_passive_checked' => 'CASE WHEN ss.active_checks_enabled = 0 AND ss.passive_checks_enabled = 1 THEN 1 ELSE 0 END',
'is_active_checked' => 'ss.active_checks_enabled',
'is_processing_events' => 'ss.event_handler_enabled',
'is_triggering_notifications' => 'ss.notifications_enabled',
'is_allowed_to_flap' => 'ss.flap_detection_enabled',
'is_flapping' => 'ss.is_flapping',
'object_type' => '(\'service\')'
));
$union = $this->db->select()->union(array($hosts, $services), Zend_Db_Select::SQL_UNION_ALL);
$this->baseQuery = $this->db->select()->from(array('statussummary' => $union), array());

View File

@ -40,19 +40,162 @@ class StatusSummary extends DataView
{
return array(
'hosts_up',
'hosts_unreachable_handled',
'hosts_unreachable_unhandled',
'hosts_up_not_checked',
'hosts_pending',
'hosts_pending_not_checked',
'hosts_down',
'hosts_down_handled',
'hosts_down_unhandled',
'hosts_pending',
'hosts_down_handled_active',
'hosts_down_handled_passive',
'hosts_down_handled_not_checked',
'hosts_down_unhandled_active',
'hosts_down_unhandled_passive',
'hosts_down_unhandled_not_checked',
'hosts_unreachable',
'hosts_unreachable_handled',
'hosts_unreachable_unhandled',
'hosts_unreachable_handled_active',
'hosts_unreachable_handled_passive',
'hosts_unreachable_handled_not_checked',
'hosts_unreachable_unhandled_active',
'hosts_unreachable_unhandled_passive',
'hosts_unreachable_unhandled_not_checked',
'hosts_active',
'hosts_passive',
'hosts_not_checked',
'hosts_processing_event_handlers',
'hosts_triggering_notifications',
'hosts_with_flap_detection',
'hosts_flapping',
'services_ok',
'services_critical_handled',
'services_critical_unhandled',
'services_ok_not_checked',
'services_pending',
'services_pending_not_checked',
'services_warning',
'services_warning_handled',
'services_warning_unhandled',
'services_warning_handled_active',
'services_warning_handled_passive',
'services_warning_handled_not_checked',
'services_warning_unhandled_active',
'services_warning_unhandled_passive',
'services_warning_unhandled_not_checked',
'services_critical',
'services_critical_handled',
'services_critical_unhandled',
'services_critical_handled_active',
'services_critical_handled_passive',
'services_critical_handled_not_checked',
'services_critical_unhandled_active',
'services_critical_unhandled_passive',
'services_critical_unhandled_not_checked',
'services_unknown',
'services_unknown_handled',
'services_unknown_unhandled',
'services_pending'
'services_unknown_handled_active',
'services_unknown_handled_passive',
'services_unknown_handled_not_checked',
'services_unknown_unhandled_active',
'services_unknown_unhandled_passive',
'services_unknown_unhandled_not_checked',
'services_active',
'services_passive',
'services_not_checked',
'services_processing_event_handlers',
'services_triggering_notifications',
'services_with_flap_detection',
'services_flapping',
'services_ok_on_up_hosts',
'services_ok_not_checked_on_up_hosts',
'services_pending_on_up_hosts',
'services_pending_not_checked_on_up_hosts',
'services_warning_handled_active_on_up_hosts',
'services_warning_handled_passive_on_up_hosts',
'services_warning_handled_not_checked_on_up_hosts',
'services_warning_unhandled_active_on_up_hosts',
'services_warning_unhandled_passive_on_up_hosts',
'services_warning_unhandled_not_checked_on_up_hosts',
'services_critical_handled_active_on_up_hosts',
'services_critical_handled_passive_on_up_hosts',
'services_critical_handled_not_checked_on_up_hosts',
'services_critical_unhandled_active_on_up_hosts',
'services_critical_unhandled_passive_on_up_hosts',
'services_critical_unhandled_not_checked_on_up_hosts',
'services_unknown_handled_active_on_up_hosts',
'services_unknown_handled_passive_on_up_hosts',
'services_unknown_handled_not_checked_on_up_hosts',
'services_unknown_unhandled_active_on_up_hosts',
'services_unknown_unhandled_passive_on_up_hosts',
'services_unknown_unhandled_not_checked_on_up_hosts',
'services_ok_on_down_hosts',
'services_ok_not_checked_on_down_hosts',
'services_pending_on_down_hosts',
'services_pending_not_checked_on_down_hosts',
'services_warning_handled_active_on_down_hosts',
'services_warning_handled_passive_on_down_hosts',
'services_warning_handled_not_checked_on_down_hosts',
'services_warning_unhandled_active_on_down_hosts',
'services_warning_unhandled_passive_on_down_hosts',
'services_warning_unhandled_not_checked_on_down_hosts',
'services_critical_handled_active_on_down_hosts',
'services_critical_handled_passive_on_down_hosts',
'services_critical_handled_not_checked_on_down_hosts',
'services_critical_unhandled_active_on_down_hosts',
'services_critical_unhandled_passive_on_down_hosts',
'services_critical_unhandled_not_checked_on_down_hosts',
'services_unknown_handled_active_on_down_hosts',
'services_unknown_handled_passive_on_down_hosts',
'services_unknown_handled_not_checked_on_down_hosts',
'services_unknown_unhandled_active_on_down_hosts',
'services_unknown_unhandled_passive_on_down_hosts',
'services_unknown_unhandled_not_checked_on_down_hosts',
'services_ok_on_unreachable_hosts',
'services_ok_not_checked_on_unreachable_hosts',
'services_pending_on_unreachable_hosts',
'services_pending_not_checked_on_unreachable_hosts',
'services_warning_handled_active_on_unreachable_hosts',
'services_warning_handled_passive_on_unreachable_hosts',
'services_warning_handled_not_checked_on_unreachable_hosts',
'services_warning_unhandled_active_on_unreachable_hosts',
'services_warning_unhandled_passive_on_unreachable_hosts',
'services_warning_unhandled_not_checked_on_unreachable_hosts',
'services_critical_handled_active_on_unreachable_hosts',
'services_critical_handled_passive_on_unreachable_hosts',
'services_critical_handled_not_checked_on_unreachable_hosts',
'services_critical_unhandled_active_on_unreachable_hosts',
'services_critical_unhandled_passive_on_unreachable_hosts',
'services_critical_unhandled_not_checked_on_unreachable_hosts',
'services_unknown_handled_active_on_unreachable_hosts',
'services_unknown_handled_passive_on_unreachable_hosts',
'services_unknown_handled_not_checked_on_unreachable_hosts',
'services_unknown_unhandled_active_on_unreachable_hosts',
'services_unknown_unhandled_passive_on_unreachable_hosts',
'services_unknown_unhandled_not_checked_on_unreachable_hosts',
'services_ok_on_pending_hosts',
'services_ok_not_checked_on_pending_hosts',
'services_pending_on_pending_hosts',
'services_pending_not_checked_on_pending_hosts',
'services_warning_handled_active_on_pending_hosts',
'services_warning_handled_passive_on_pending_hosts',
'services_warning_handled_not_checked_on_pending_hosts',
'services_warning_unhandled_active_on_pending_hosts',
'services_warning_unhandled_passive_on_pending_hosts',
'services_warning_unhandled_not_checked_on_pending_hosts',
'services_critical_handled_active_on_pending_hosts',
'services_critical_handled_passive_on_pending_hosts',
'services_critical_handled_not_checked_on_pending_hosts',
'services_critical_unhandled_active_on_pending_hosts',
'services_critical_unhandled_passive_on_pending_hosts',
'services_critical_unhandled_not_checked_on_pending_hosts',
'services_unknown_handled_active_on_pending_hosts',
'services_unknown_handled_passive_on_pending_hosts',
'services_unknown_handled_not_checked_on_pending_hosts',
'services_unknown_unhandled_active_on_pending_hosts',
'services_unknown_unhandled_passive_on_pending_hosts',
'services_unknown_unhandled_not_checked_on_pending_hosts'
);
}
}

View File

@ -39,6 +39,12 @@
@colorWarning : #FFA500;
@colorUnreachable : #E066FF;
table.tacticalTable {
border: 0px;
border-collapse: separate;
border-spacing: 5px;
}
.host-name {
display: block;
margin-top: 5px;
@ -90,6 +96,18 @@
Status colors
========================================================================== */
.status-ok {
background-color: @colorOk!important;
}
.status-down {
background-color: @colorDown!important;
}
.status-unreachable {
background-color: @colorUnreachable!important;
}
.status-up {
background-color: @colorUp!important;
}