diff --git a/src/Centreon/Domain/Monitoring/MonitoringService.php b/src/Centreon/Domain/Monitoring/MonitoringService.php index 65f9be9db4e..0436a8fc2e7 100644 --- a/src/Centreon/Domain/Monitoring/MonitoringService.php +++ b/src/Centreon/Domain/Monitoring/MonitoringService.php @@ -387,12 +387,8 @@ public function hidePasswordInServiceCommandLine(Service $monitoringService, str $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 !== null - && $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); return;