Skip to main content

Hello,

In some services, the following message appears instead of the command:

“Unable to hide passwords in command (Reason: Macro passwords cannot be detected)”

Even though there are no password-type macros.

The cause is in this file

/usr/share/centreon/src/Centreon/Domain/Monitoring/CommandLineTrait.php

Line 153, you must comment this block as follow :

        // if two macros are glued or separated by spaces, regex cannot detect properly password string
/** if (preg_match('/\(\.\*\)\s*\(\.\*\)/', $macroPattern)) {
throw MonitoringServiceException::macroPasswordNotDetected();
}
**/

With this you will have your command line shown as expected , and from my test, the password hiding is still working.

Can you maybe provide an anonymized command that would have that exact issue so this can be reproduced ?


This one, cut and paste from the UI (with the bloc commented), I only change the real username with “xxx” 

/usr/lib/nagios/plugins/customs/check_oracle_health --connect=edrv-e09-bdd-oracle-1_PASE --username=xxx --password=*** --report short --mode=invalid-objects