getThem($service); } catch (Exception $e) { return []; } } /** * @param Service $service * @return array * @throws \Icinga\Exception\ProgrammingError */ protected function getThem(Service $service) { $actions = []; $db = $this->db(); if (! $db) { return []; } $hostname = $service->host_name; if (Util::hasPermission('director/inspect')) { $actions['Inspect'] = Url::fromPath('director/inspect/object', [ 'type' => 'service', 'plural' => 'services', 'name' => sprintf( '%s!%s', $hostname, $service->service_description ) ]); } if (IcingaHost::exists($hostname, $db)) { $actions['Modify'] = Url::fromPath('director/host/findservice', [ 'name' => $hostname, 'service' => $service->service_description ]); } return $actions; } protected function db() { $resourceName = Config::module('director')->get('db', 'resource'); if (! $resourceName) { return false; } return Db::fromResourceName($resourceName); } }