138 lines
6.0 KiB
PHTML
138 lines
6.0 KiB
PHTML
<?php
|
|
|
|
$type = $object->type === 2 ? 'service' : 'host';
|
|
|
|
/** @var Zend_View_Helper_CommandForm $cf */
|
|
$cf = $this->getHelper('CommandForm');
|
|
|
|
if ($type === 'host') {
|
|
$objectStateName = strtolower($this->util()->getHostStateName($this->object->host_state));
|
|
$objectState = (int) $object->host_state;
|
|
} else {
|
|
$objectStateName = strtolower($this->util()->getServiceStateName($this->object->service_state));
|
|
$objectState = (int) $object->service_state;
|
|
}
|
|
?>
|
|
<div>
|
|
<div class="panel-heading border-status-<?= $objectStateName ?>">
|
|
<div class="panel-hostname">
|
|
|
|
|
|
<div class="small-row">
|
|
|
|
<?php if ($object->action_url || $object->notes_url): ?>
|
|
<br />
|
|
<?php if ($object->notes_url): ?>
|
|
<?php if (strpos($object->notes_url, "' ") === false): ?>
|
|
<a target="_new" href='<?= $this->escape($this->resolveMacros($object->notes_url, $object)); ?>'>Notes</a>
|
|
<?php else: ?>
|
|
<?php foreach(explode("' ", $object->notes_url) as $url): ?>
|
|
<?php $url = strpos($url, "'") === 0 ? substr($url, 1) : $url; ?>
|
|
<?php $url = strrpos($url, "'") === strlen($url) - 1 ? substr($url, 0, strlen($url) - 1) : $url; ?>
|
|
<a target="_new" href='<?= $this->escape($this->resolveMacros($url, $object)); ?>'>Notes</a>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php if ($object->action_url): ?>
|
|
<?php if (strpos($object->action_url, "' ") === false): ?>
|
|
<a target="_new" href='<?= $this->escape($this->resolveMacros($this->object->action_url, $object)); ?>'>Action</a>
|
|
<?php else: ?>
|
|
<?php foreach(explode("' ", $object->action_url) as $url): ?>
|
|
<?php $url = strpos($url, "'") === 0 ? substr($url, 1) : $url; ?>
|
|
<?php $url = strrpos($url, "'") === strlen($url) - 1 ? substr($url, 0, strlen($url) - 1) : $url; ?>
|
|
<a target="_new" href='<?= $this->escape($this->resolveMacros($url, $object)); ?>'>Action</a>
|
|
<?php endforeach; ?>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<hr class="separator" />
|
|
|
|
<div class="panel-body">
|
|
|
|
<div class="panel-row">
|
|
|
|
<?php if ($objectState > 0): ?>
|
|
<?php if ($this->object->host_acknowledged || $this->object->service_acknowledged): ?>
|
|
<?= $cf->labelSubmitForm(
|
|
'Remove Ack',
|
|
'Remove problem acknowledgement',
|
|
'btn-cta btn-half-left',
|
|
'removeacknowledgement',
|
|
array(
|
|
'host' => $this->object->host_name,
|
|
'service' => $this->object->service_description
|
|
)
|
|
) ?>
|
|
<?php else: ?>
|
|
<a rel="tooltip" title="Acknowledge Problems" href="<?=
|
|
$this->href(
|
|
'monitoring/command/acknowledgeproblem',
|
|
array(
|
|
'host' => $this->object->host_name,
|
|
'service' => $this->object->service_description
|
|
)
|
|
);
|
|
?>" class="button btn-cta btn-half-left">
|
|
Acknowledge
|
|
</a>
|
|
<?php endif; ?>
|
|
<?php endif; ?>
|
|
<?= $cf->labelSubmitForm(
|
|
'Recheck',
|
|
'Reschedule next check immediately',
|
|
'btn-cta ' . (($objectState > 0) ? 'btn-half-right' : 'btn-wide'),
|
|
'reschedulenextcheck',
|
|
array(
|
|
'host' => $this->object->host_name,
|
|
'service' => $this->object->service_description,
|
|
'checktime' => time(),
|
|
'forcecheck' => '1'
|
|
)
|
|
) ?>
|
|
</div>
|
|
|
|
<?php if ($objectState > 0): ?>
|
|
<?php
|
|
if ($object->service_description) {
|
|
$notificationsHref = $this->href(
|
|
'monitoring/list/notifications',
|
|
array(
|
|
'host' => $object->host_name,
|
|
'service' => $object->service_description
|
|
)
|
|
);
|
|
} else {
|
|
$notificationsHref = $this->href(
|
|
'monitoring/list/notifications',
|
|
array(
|
|
'host' => $object->host_name
|
|
)
|
|
);
|
|
}
|
|
?>
|
|
<div class="panel-row">
|
|
<div class="panel-label">
|
|
Last Notification
|
|
</div>
|
|
<div class="panel-content">
|
|
<a href="<?= $notificationsHref ?>">
|
|
<?php if ($object->last_notification === '0000-00-00 00:00:00'): ?>
|
|
N/A
|
|
<?php else: ?>
|
|
<?= $object->last_notification ?>
|
|
<?php if ($object->current_notification_number > 0): ?>
|
|
<br />
|
|
<?= $object->current_notification_number ?> notifications sent during current problem state
|
|
<?php endif ;?>
|
|
<?php endif; ?>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</div>
|