Skip to main content

In service details : Unable to hide passwords in command (Reason: Macro passwords cannot be detected)

  • September 15, 2025
  • 3 replies
  • 37 views

Forum|alt.badge.img+11

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.

3 replies

Forum|alt.badge.img+10

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


Forum|alt.badge.img+11
  • Author
  • Builder *
  • 48 replies
  • September 17, 2025

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   

 


Forum|alt.badge.img
  • Steward *
  • 1 reply
  • October 13, 2025

I am having the exact same Problem but your change to that file doesn’t work with me.