2013-10-10 15:36:53 +02:00
|
|
|
<?php
|
|
|
|
$o = $this->object;
|
2014-03-07 10:41:59 +01:00
|
|
|
$isService = (isset($o->service_description)) ? true : false;
|
2014-02-18 20:17:33 +01:00
|
|
|
$obj = new \stdClass();
|
|
|
|
$obj->handled =
|
2013-10-10 15:36:53 +02:00
|
|
|
($isService) ? $o->service_handled : $o->host_handled;
|
2014-02-18 20:17:33 +01:00
|
|
|
$obj->state =
|
2013-10-10 15:36:53 +02:00
|
|
|
($isService) ? $o->service_state : $o->host_state;
|
2014-02-18 20:17:33 +01:00
|
|
|
$obj->acknowledged =
|
2013-10-10 15:36:53 +02:00
|
|
|
($isService) ? $o->service_acknowledged : $o->host_acknowledged;
|
2014-02-18 20:17:33 +01:00
|
|
|
$obj->in_downtime =
|
2013-10-10 15:36:53 +02:00
|
|
|
($isService) ? $o->in_downtime : $o->host_in_downtime;
|
2014-03-07 10:41:59 +01:00
|
|
|
$obj->is_flapping =
|
|
|
|
($isService) ? $o->is_flapping : $o->host_is_flapping;
|
2014-02-18 20:17:33 +01:00
|
|
|
$obj->notifications_enabled =
|
2013-10-10 15:36:53 +02:00
|
|
|
($isService) ? $o->notifications_enabled : $o->service_notifications_enabled;
|
2014-02-18 20:17:33 +01:00
|
|
|
$obj->active_checks_enabled =
|
2013-10-10 15:36:53 +02:00
|
|
|
($isService) ? $o->active_checks_enabled : $o->host_active_checks_enabled;
|
2014-02-18 20:17:33 +01:00
|
|
|
$obj->passive_checks_enabled =
|
2013-10-10 15:36:53 +02:00
|
|
|
($isService) ? $o->passive_checks_enabled : $o->host_passive_checks_enabled;
|
2014-03-07 10:41:59 +01:00
|
|
|
$obj->last_comment =
|
|
|
|
($isService) ? $o->last_comment : $o->host_last_comment;
|
2014-02-18 20:17:33 +01:00
|
|
|
|
|
|
|
$i = array();
|
|
|
|
if (! $obj->handled && $obj->state > 0) {
|
2014-03-07 10:41:59 +01:00
|
|
|
$i[] = $this->img('img/icons/unhandled.png', array('title' => 'Unhandled'));
|
2014-02-18 20:17:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($obj->acknowledged && ! $obj->in_downtime) {
|
2014-03-06 20:00:10 +01:00
|
|
|
$i[] = $this->icon('acknowledgement.png', 'Acknowledged');
|
2014-02-18 20:17:33 +01:00
|
|
|
}
|
|
|
|
|
2014-03-07 10:41:59 +01:00
|
|
|
if ($obj->is_flapping) {
|
|
|
|
$i[] = $this->icon('flapping.png', 'Flapping');
|
|
|
|
}
|
|
|
|
|
2014-02-18 20:17:33 +01:00
|
|
|
if (!$obj->notifications_enabled) {
|
2014-03-07 10:41:59 +01:00
|
|
|
$i[] = $this->img('img/icons/notification_disabled.png', array('title' => 'Notifications Disabled'));
|
2014-02-18 20:17:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if ($obj->in_downtime) {
|
2014-03-07 10:41:59 +01:00
|
|
|
$i[] = $this->img('img/icons/in_downtime.png', array('title' => 'In Downtime'));
|
2014-02-18 20:17:33 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
if (! $obj->active_checks_enabled) {
|
|
|
|
if ($obj->passive_checks_enabled) {
|
2014-03-07 10:41:59 +01:00
|
|
|
$i[] = $this->img(
|
|
|
|
'img/icons/active_checks_disabled.png',
|
|
|
|
array('title' => 'Active Checks Disabled')
|
|
|
|
);
|
2014-02-18 20:17:33 +01:00
|
|
|
} else {
|
2014-03-07 10:41:59 +01:00
|
|
|
$i[] = $this->img(
|
|
|
|
'img/icons/active_passive_checks_disabled.png',
|
|
|
|
array('title' => 'Active And Passive Checks Disabled')
|
|
|
|
);
|
2014-02-18 20:17:33 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2014-03-07 10:41:59 +01:00
|
|
|
if ($obj->last_comment !== null) {
|
|
|
|
$i[] = $this->icon('comment.png', 'Comments');
|
|
|
|
}
|
|
|
|
|
|
|
|
?><span>
|
|
|
|
<?= implode("\n ", $i) . "\n" ?>
|
|
|
|
</span>
|
|
|
|
|