count === null) { $storage = LegacyStorage::getInstance(); $count = 0; foreach ($storage->listProcessNames() as $processName) { $bp = $storage->loadProcess($processName); if (Module::exists('icingadb') && (! $bp->hasBackendName() && IcingadbSupport::useIcingaDbAsBackend()) ) { IcingaDbState::apply($bp); } else { MonitoringState::apply($bp); } foreach ($bp->getRootNodes() as $rootNode) { if (! $rootNode->isEmpty() && $rootNode->getState() !== $rootNode::ICINGA_PENDING && $rootNode->hasProblems()) { $count++; break; } } } $this->count = $count; $this->setState(self::STATE_CRITICAL); } return $this->count; } }