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() && ! in_array($rootNode->getState(), [Node::ICINGA_OK, Node::ICINGA_PENDING], true)) { $count++; break; } } } $this->count = $count; $this->setState(self::STATE_CRITICAL); } return $this->count; } }