From de80ea1e0cdeedbe4722e99339e06181eb2de802 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] ix(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 | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 {