getModuleManager(); if (!$modules->hasLoaded('monitoring') && $app->isCli()) { $app->getModuleManager()->loadEnabledModules(); } if ($modules->hasLoaded('monitoring')) { $this->backend = MonitoringBackend::instance(); } } 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; } }