diff --git a/modules/monitoring/application/controllers/HostController.php b/modules/monitoring/application/controllers/HostController.php index 464da200c..c014b96f6 100644 --- a/modules/monitoring/application/controllers/HostController.php +++ b/modules/monitoring/application/controllers/HostController.php @@ -10,6 +10,7 @@ use Icinga\Module\Monitoring\Forms\Command\Object\SendCustomNotificationCommandF use Icinga\Module\Monitoring\Object\Host; use Icinga\Module\Monitoring\Web\Controller\MonitoredObjectController; use Icinga\Web\Hook; +use Icinga\Web\Widget; class Monitoring_HostController extends MonitoredObjectController { @@ -63,6 +64,55 @@ class Monitoring_HostController extends MonitoredObjectController 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 */ diff --git a/modules/monitoring/application/views/scripts/host/services.phtml b/modules/monitoring/application/views/scripts/host/services.phtml new file mode 100644 index 000000000..ca12f3d0e --- /dev/null +++ b/modules/monitoring/application/views/scripts/host/services.phtml @@ -0,0 +1,17 @@ +