diff --git a/library/Icingadb/ProvidedHook/X509/Sni.php b/library/Icingadb/ProvidedHook/X509/Sni.php index ef95c2ec..6f20a7df 100644 --- a/library/Icingadb/ProvidedHook/X509/Sni.php +++ b/library/Icingadb/ProvidedHook/X509/Sni.php @@ -22,17 +22,14 @@ class Sni extends SniHook */ public function getHosts(Filter $filter = null): Generator { - $queryHost = Host::on($this->getDb()); + $this->getDb()->ping(); - $queryHost->getSelectBase(); - - $hostStatusCols = [ - 'host_name' => 'name', - 'host_address' => 'address', - 'host_address6' => 'address6' - ]; - - $queryHost = $queryHost->columns($hostStatusCols); + $queryHost = Host::on($this->getDb()) + ->columns([ + 'host_name' => 'name', + 'host_address' => 'address', + 'host_address6' => 'address6' + ]); $this->applyRestrictions($queryHost);