getModuleManager(); if (!$modules->hasLoaded('monitoring') && $app->isCli()) { $app->getModuleManager()->loadEnabledModules(); } if ($modules->hasLoaded('monitoring')) { $this->backend = MonitoringBackend::createBackend(); } } public function isAvailable() { return $this->backend !== null; } public function hasHost($hostname) { return $this->backend->select()->from('hostStatus', array( 'hostname' => 'host_name', ))->where('host_name', $hostname)->fetchOne() === $hostname; } }