Value for property: DBUserName for credential ID=SQLCreds has an invalid format

Those days, while testing Oracle Management Cloud Service (OMC), I was trying to deploy the agent to monitor my Oracle Database, but it was failing with "Value for property: DBUserName for credential ID=SQLCreds has an invalid format".

[oracle@test bin]$ ./omcli add_entity agent /home/oracle/agent_json/entity.json -credential_file /home/oracle/agent_json/credential.json
Oracle Management Cloud Agent
Copyright (c) 1996, 2019 Oracle Corporation.  All rights reserved.
Value for property: DBUserName for credential ID=SQLCreds has an invalid format
[oracle@test bin]

I couldn't figure out what was the problem. My credential file was with the following properties:

{"credentials":[
    {
      "id": "SQLCreds",
      "name": "SQLCreds",
      "credType": "DBCreds",
      "properties": [
        {
          "name": "DBUserName",
          "value": "dbsnmp"
        },
        {
          "name": "DBPassword",
          "value": "oracle"
        },
        {
           "name":"DBRole",
           "value":"Normal"
        }
      ]
    }
]}

When I double checked the template, I finally noticed that the CLEAR part of the "value" fields should not be removed.. duh.

So it finally worked after changing to:

{
   "credentials":[
      {
         "id":"SQLCreds",
         "name":"SQLCreds",
         "credType":"DBCreds",
         "properties":[
            {
               "name":"DBUserName",
               "value":"CLEAR[dbsnmp]"
            },
            {
               "name":"DBPassword",
               "value":"CLEAR[oracle]"
            },
            {
               "name":"DBRole",
               "value":"CLEAR[Normal]"
            }
         ]
      }
   ]
}
[oracle@test bin]$ ./omcli add_entity agent /home/oracle/agent_json/entity.json -credential_file /home/oracle/agent_json/credential.json
Oracle Management Cloud Agent
Copyright (c) 1996, 2019 Oracle Corporation.  All rights reserved.
Operation Succeeded: Accepted 1 of 1 entities for processing.
[oracle@test bin]
Have you enjoyed? Please leave a comment or give a 👍!

Leave a Reply

Your email address will not be published.