diff --git a/src/Centreon/Domain/Monitoring/MonitoringService.php b/src/Centreon/Domain/Monitoring/MonitoringService.php index cba2be8f65d..c1144a6dd0b 100644 --- a/src/Centreon/Domain/Monitoring/MonitoringService.php +++ b/src/Centreon/Domain/Monitoring/MonitoringService.php @@ -351,9 +351,8 @@ public function hidePasswordInCommandLine(Service $monitoringService, string $re $configurationCommand = $this->serviceConfiguration->findCommandLine($monitoringService->getId()); if (empty($configurationCommand)) { - // If there is no command line defined in the configuration, it's useless to continue. - $service = $this->serviceConfiguration->findService($monitoringService->getId()); - if ($service->getServiceType() === \Centreon\Domain\ServiceConfiguration\Service::TYPE_META_SERVICE) { + // Meta Service case + if (preg_match('/^meta_[0-9]+$/', $monitoringService->getDescription())) { // For META SERVICE we can define the configuration command line with the monitoring command line $monitoringService->setCommandLine($monitoringCommand); } else {