From 543601e5c68bd1a7454a20a94c806d903b3e3480 Mon Sep 17 00:00:00 2001 From: Thomas Gelf Date: Tue, 9 Feb 2016 20:38:56 +0100 Subject: [PATCH] InspectController: discover endpoint if none given Also fixes host/service inspect hooks --- application/controllers/InspectController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/application/controllers/InspectController.php b/application/controllers/InspectController.php index 02248aa2..2814af10 100644 --- a/application/controllers/InspectController.php +++ b/application/controllers/InspectController.php @@ -98,6 +98,10 @@ class InspectController extends ActionController protected function api() { $this->view->endpoint = $this->params->get('endpoint'); + if ($this->view->endpoint === null) { + $this->view->endpoint = $this->db()->getDeploymentEndpointName(); + } + $endpoint = IcingaEndpoint::load($this->view->endpoint, $this->db()); $apiconfig = $this->Config()->getSection('api'); $client = new RestApiClient($endpoint->host, $endpoint->port);