From ecc157ed27aa69561572229790eb2ca788e69d5f Mon Sep 17 00:00:00 2001 From: Adrien Morais <31647811+adr-mo@users.noreply.github.com> Date: Wed, 31 Mar 2021 10:19:26 +0200 Subject: [PATCH] fix(monitoring): issue with command line for meta service (#9634) * fix(monitoring): issue with command line for meta service * Update src/Centreon/Domain/Monitoring/MonitoringService.php Co-authored-by: Kevin Duret Co-authored-by: Kevin Duret --- src/Centreon/Domain/Monitoring/MonitoringService.php | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) 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;