mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-27 07:44:04 +02:00
HostController: Add action to show a host's services
This commit is contained in:
parent
c221e0c082
commit
d81e637ae9
@ -10,6 +10,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\SendCustomNotificationCommandF
|
|||||||
use Icinga\Module\Monitoring\Object\Host;
|
use Icinga\Module\Monitoring\Object\Host;
|
||||||
use Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController;
|
use Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController;
|
||||||
use Icinga\Web\Hook;
|
use Icinga\Web\Hook;
|
||||||
|
use Icinga\Web\Widget;
|
||||||
|
|
||||||
class Monitoring_HostController extends MonitoredObjectController
|
class Monitoring_HostController extends MonitoredObjectController
|
||||||
{
|
{
|
||||||
@ -63,6 +64,55 @@ class Monitoring_HostController extends MonitoredObjectController
|
|||||||
parent::showAction();
|
parent::showAction();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List a host's services
|
||||||
|
*/
|
||||||
|
public function servicesAction()
|
||||||
|
{
|
||||||
|
$this->setAutorefreshInterval(10);
|
||||||
|
$this->getTabs()->activate('services');
|
||||||
|
$query = $this->backend->select()->from('serviceStatus', array(
|
||||||
|
'host_name',
|
||||||
|
'host_display_name',
|
||||||
|
'host_state',
|
||||||
|
'host_state_type',
|
||||||
|
'host_last_state_change',
|
||||||
|
'host_address',
|
||||||
|
'host_handled',
|
||||||
|
'service_description',
|
||||||
|
'service_display_name',
|
||||||
|
'service_state',
|
||||||
|
'service_in_downtime',
|
||||||
|
'service_acknowledged',
|
||||||
|
'service_handled',
|
||||||
|
'service_output',
|
||||||
|
'service_perfdata',
|
||||||
|
'service_attempt',
|
||||||
|
'service_last_state_change',
|
||||||
|
'service_icon_image',
|
||||||
|
'service_icon_image_alt',
|
||||||
|
'service_is_flapping',
|
||||||
|
'service_state_type',
|
||||||
|
'service_handled',
|
||||||
|
'service_severity',
|
||||||
|
'service_last_check',
|
||||||
|
'service_notifications_enabled',
|
||||||
|
'service_action_url',
|
||||||
|
'service_notes_url',
|
||||||
|
'service_last_comment',
|
||||||
|
'service_last_ack',
|
||||||
|
'service_last_downtime',
|
||||||
|
'service_active_checks_enabled',
|
||||||
|
'service_passive_checks_enabled',
|
||||||
|
'current_check_attempt' => 'service_current_check_attempt',
|
||||||
|
'max_check_attempts' => 'service_max_check_attempts'
|
||||||
|
));
|
||||||
|
$query->applyFilter(Widget::create('filterEditor')->setQuery($query)->getFilter());
|
||||||
|
$this->applyRestriction('monitoring/filter/objects', $query);
|
||||||
|
$this->view->services = $query;
|
||||||
|
$this->view->object = $this->object;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Acknowledge a host problem
|
* Acknowledge a host problem
|
||||||
*/
|
*/
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
<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>
|
||||||
|
<?= $this->partial(
|
||||||
|
'list/services.phtml',
|
||||||
|
'monitoring',
|
||||||
|
array(
|
||||||
|
'compact' => true,
|
||||||
|
'showHost' => false,
|
||||||
|
'services' => $services,
|
||||||
|
'addColumns' => array()
|
||||||
|
)
|
||||||
|
); ?>
|
Loading…
x
Reference in New Issue
Block a user