diff --git a/dbm-services/redis/db-tools/dbmon/models/myredis/myredis.go b/dbm-services/redis/db-tools/dbmon/models/myredis/myredis.go index 19eed8473f..7f65943e46 100644 --- a/dbm-services/redis/db-tools/dbmon/models/myredis/myredis.go +++ b/dbm-services/redis/db-tools/dbmon/models/myredis/myredis.go @@ -97,7 +97,7 @@ func GetProxyPasswdFromConfFlie(port int, role string) (password string, err err if err != nil { return } - grepCmd = fmt.Sprintf(`grep -w "password" %s|grep -vE "#"|awk '{print $NF}'`, confFile) + grepCmd = fmt.Sprintf(`grep -w "password" %s|grep -vE "^#"|awk '{print $NF}'`, confFile) } else if role == consts.MetaRolePredixy { confFile, err = GetPredixyLocalConfFile(port) if err != nil {