commit
3e29046f56
|
@ -133,6 +133,8 @@ class Monitoring_HostsController extends Controller
|
|||
$this->view->objects = $this->hostList;
|
||||
$this->view->unhandledObjects = $this->hostList->getUnhandledObjects();
|
||||
$this->view->problemObjects = $this->hostList->getProblemObjects();
|
||||
$this->view->acknowledgeUnhandledLink = Url::fromPath('monitoring/hosts/acknowledge-problem')
|
||||
->setQueryString($this->hostList->getUnhandledObjects()->objectsFilter()->toQueryString());
|
||||
$this->view->downtimeUnhandledLink = Url::fromPath('monitoring/hosts/schedule-downtime')
|
||||
->setQueryString($this->hostList->getUnhandledObjects()->objectsFilter()->toQueryString());
|
||||
$this->view->downtimeLink = Url::fromPath('monitoring/hosts/schedule-downtime')
|
||||
|
|
|
@ -78,20 +78,6 @@ class Monitoring_ShowController extends Controller
|
|||
$this->setupPaginationControl($this->view->history, 50);
|
||||
}
|
||||
|
||||
public function servicesAction()
|
||||
{
|
||||
$this->setAutorefreshInterval(15);
|
||||
$this->getTabs()->activate('services');
|
||||
$this->_setParam('service', '');
|
||||
// TODO: This used to be a hack and still is. Modifying query string here.
|
||||
$_SERVER['QUERY_STRING'] = (string) $this->params->without('service')->set('limit', '');
|
||||
$this->view->services = $this->view->action('services', 'list', 'monitoring', array(
|
||||
'view' => 'compact',
|
||||
'sort' => 'service_description',
|
||||
));
|
||||
$this->fetchHostStats();
|
||||
}
|
||||
|
||||
protected function fetchHostStats()
|
||||
{
|
||||
$this->view->stats = $this->backend->select()->from('statusSummary', array(
|
||||
|
@ -228,19 +214,6 @@ class Monitoring_ShowController extends Controller
|
|||
)
|
||||
);
|
||||
}
|
||||
$tabs->add(
|
||||
'services',
|
||||
array(
|
||||
'title' => sprintf(
|
||||
$this->translate('List all services on host %s'),
|
||||
$isService ? $object->getHost()->getName() : $object->getName()
|
||||
),
|
||||
'label' => $this->translate('Services'),
|
||||
'icon' => 'services',
|
||||
'url' => 'monitoring/show/services',
|
||||
'urlParams' => $params,
|
||||
)
|
||||
);
|
||||
if ($this->backend->hasQuery('eventHistory')) {
|
||||
$tabs->add(
|
||||
'history',
|
||||
|
|
|
@ -69,7 +69,7 @@ if (count($hosts) === 0) {
|
|||
$this->translatePlural('%u unhandled service', '%u unhandled services', $host->host_unhandled_services),
|
||||
$host->host_unhandled_services
|
||||
),
|
||||
'monitoring/show/services',
|
||||
'monitoring/list/services',
|
||||
array(
|
||||
'host' => $host->host_name,
|
||||
'service_problem' => 1,
|
||||
|
|
|
@ -67,7 +67,7 @@ foreach ($serviceDescriptions as $service_description): ?>
|
|||
<th>
|
||||
<?= $this->qlink(
|
||||
$host_name,
|
||||
'monitoring/show/services?' . $serviceFilter,
|
||||
'monitoring/list/services?' . $serviceFilter,
|
||||
array('host' => $host_name),
|
||||
array('title' => sprintf($this->translate('List all reported services on host %s'), $host_name))
|
||||
); ?>
|
||||
|
|
|
@ -12,8 +12,7 @@ function urlAddFilterOptional($url, $filter, $optional) {
|
|||
return $url->setQueryString($f->toQueryString());
|
||||
}
|
||||
|
||||
$selfUrl = Url::fromPath('monitoring/show/services', array('host' => $object->host_name));
|
||||
$currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
|
||||
$selfUrl = Url::fromPath('monitoring/list/services', array('host' => $object->host_name));
|
||||
?><div class="tinystatesummary" <?= $this->compact ? ' data-base-target="col1"' : ''; ?>>
|
||||
<?php if ($object->stats->services_total): ?>
|
||||
<?= $this->qlink(
|
||||
|
@ -27,7 +26,8 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
|
|||
),
|
||||
$selfUrl,
|
||||
null,
|
||||
array('title' => sprintf(
|
||||
array(
|
||||
'title' => sprintf(
|
||||
$this->translatePlural(
|
||||
'List all %u service on host %s',
|
||||
'List all %u services on host %s',
|
||||
|
@ -35,7 +35,9 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
|
|||
),
|
||||
$object->stats->services_total,
|
||||
$object->host_name
|
||||
))
|
||||
),
|
||||
'data-base-target' => '_next'
|
||||
)
|
||||
); ?>
|
||||
<?php else: ?>
|
||||
<?= $this->translate('No services configured on this host'); ?>
|
||||
|
@ -43,12 +45,13 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
|
|||
|
||||
<span class="badges">
|
||||
<?php if ($object->stats->services_ok): ?>
|
||||
<span class="state ok<?= $currentUrl === $selfUrl->with('service_state', 0)->getRelativeUrl() ? ' active' : ''; ?>">
|
||||
<span class="state ok">
|
||||
<?= $this->qlink(
|
||||
$object->stats->services_ok,
|
||||
$selfUrl,
|
||||
array('service_state' => 0),
|
||||
array('title' => sprintf(
|
||||
array(
|
||||
'title' => sprintf(
|
||||
$this->translatePlural(
|
||||
'List %u service that is currently in state OK on host %s',
|
||||
'List %u services which are currently in state OK on host %s',
|
||||
|
@ -56,7 +59,9 @@ $currentUrl = Url::fromRequest()->without('limit')->getRelativeUrl();
|
|||
),
|
||||
$object->stats->services_ok,
|
||||
$object->host_name
|
||||
))
|
||||
),
|
||||
'data-base-target' => '_next'
|
||||
)
|
||||
); ?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
|
@ -68,26 +73,15 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
|
|||
$unhandled = $pre . '_unhandled';
|
||||
$paramsHandled = array('service_state' => $stateId, 'service_handled' => 1);
|
||||
$paramsUnhandled = array('service_state' => $stateId, 'service_handled' => 0);
|
||||
if ($object->stats->$unhandled) {
|
||||
$compareUrl = $selfUrl->with($paramsUnhandled)->getRelativeUrl();
|
||||
} else {
|
||||
$compareUrl = $selfUrl->with($paramsHandled)->getRelativeUrl();
|
||||
}
|
||||
|
||||
if ($compareUrl === $currentUrl) {
|
||||
$active = ' active';
|
||||
} else {
|
||||
$active = '';
|
||||
}
|
||||
|
||||
echo '<span class="state ' . $state . $active . ($object->stats->$unhandled ? '' : ' handled') . '">';
|
||||
echo '<span class="state ' . $state . ($object->stats->$unhandled ? '' : ' handled') . '">';
|
||||
if ($object->stats->$unhandled) {
|
||||
|
||||
echo $this->qlink(
|
||||
$object->stats->$unhandled,
|
||||
$selfUrl,
|
||||
$paramsUnhandled,
|
||||
array('title' => sprintf(
|
||||
array(
|
||||
'title' => sprintf(
|
||||
$this->translatePlural(
|
||||
'List %u service that is currently in state %s on host %s',
|
||||
'List %u services which are currently in state %s on host %s',
|
||||
|
@ -96,24 +90,21 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
|
|||
$object->stats->$unhandled,
|
||||
Service::getStateText($stateId, true),
|
||||
$object->host_name
|
||||
))
|
||||
),
|
||||
'data-base-target' => '_next'
|
||||
)
|
||||
);
|
||||
}
|
||||
if ($object->stats->$handled) {
|
||||
|
||||
if ($selfUrl->with($paramsHandled)->getRelativeUrl() === $currentUrl) {
|
||||
$active = ' active';
|
||||
} else {
|
||||
$active = '';
|
||||
}
|
||||
if ($object->stats->$unhandled) {
|
||||
echo '<span class="state handled ' . $state . $active . '">';
|
||||
echo '<span class="state handled ' . $state . '">';
|
||||
}
|
||||
echo $this->qlink(
|
||||
$object->stats->$handled,
|
||||
$selfUrl,
|
||||
$paramsHandled,
|
||||
array('title' => sprintf(
|
||||
array(
|
||||
'title' => sprintf(
|
||||
$this->translatePlural(
|
||||
'List %u service that is currently in state %s (Acknowledged) on host %s',
|
||||
'List %u services which are currently in state %s (Acknowledged) on host %s',
|
||||
|
@ -122,7 +113,9 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
|
|||
$object->stats->$handled,
|
||||
Service::getStateText($stateId, true),
|
||||
$object->host_name
|
||||
))
|
||||
),
|
||||
'data-base-target' => '_next'
|
||||
)
|
||||
);
|
||||
if ($object->stats->$unhandled) {
|
||||
echo "</span>\n";
|
||||
|
@ -133,12 +126,13 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
|
|||
}
|
||||
?>
|
||||
<?php if ($object->stats->services_pending): ?>
|
||||
<span class="state pending<?= $currentUrl === $selfUrl->with('service_state', 99)->getRelativeUrl() ? ' active' : ''; ?>">
|
||||
<span class="state pending">
|
||||
<?= $this->qlink(
|
||||
$object->stats->services_pending,
|
||||
$selfUrl,
|
||||
array('service_state' => 99),
|
||||
array('title' => sprintf(
|
||||
array(
|
||||
'title' => sprintf(
|
||||
$this->translatePlural(
|
||||
'List %u service that is currently in state PENDING on host %s',
|
||||
'List %u services which are currently in state PENDING on host %s',
|
||||
|
@ -146,7 +140,9 @@ foreach (array(2 => 'critical', 3 => 'unknown', 1 => 'warning') as $stateId => $
|
|||
),
|
||||
$object->stats->services_pending,
|
||||
$object->host_name
|
||||
))
|
||||
),
|
||||
'data-base-target' => '_next'
|
||||
)
|
||||
) ?>
|
||||
</span>
|
||||
<?php endif ?>
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<div class="controls">
|
||||
<?php if (! $this->compact): ?>
|
||||
<?= $this->tabs; ?>
|
||||
<?php endif ?>
|
||||
<?= $this->render('partials/host/object-header.phtml') ?>
|
||||
<?= $this->render('partials/host/servicesummary.phtml') ?>
|
||||
</div>
|
||||
<?= $services ?>
|
|
@ -181,19 +181,6 @@ abstract class MonitoredObjectController extends Controller
|
|||
)
|
||||
);
|
||||
}
|
||||
$tabs->add(
|
||||
'services',
|
||||
array(
|
||||
'title' => sprintf(
|
||||
$this->translate('List all services on host %s'),
|
||||
$isService ? $object->getHost()->getName() : $object->getName()
|
||||
),
|
||||
'label' => $this->translate('Services'),
|
||||
'icon' => 'services',
|
||||
'url' => 'monitoring/show/services',
|
||||
'urlParams' => $params
|
||||
)
|
||||
);
|
||||
if ($this->backend->hasQuery('eventHistory')) {
|
||||
$tabs->add(
|
||||
'history',
|
||||
|
|
Loading…
Reference in New Issue