When running the mgmt_cli tool, it reads many of its activation parameters from environment variables.
This is useful when using automation scripts. It is supported both on Windows and Linux machines.
Here is a list:
Parameter Name | Command Line Switch | Environment Variable |
---|
User name | -u | MGMT_CLI_USER |
User password | -p | MGMT_CLI_PASSWORD |
Name or IP address of management domain | -d | MGMT_CLI_DOMAIN |
Management server IP address | -m | MGMT_CLI_MANAGEMENT |
Port of API server on management server | --port | MGMT_CLI_PORT |
Proxy settings | -x | MGMT_CLI_PROXY |
File containing session information using Login | -s | MGMT_CLI_SESSION_FILE |
Established session identifier (sid) using Login | --session-id | MGMT_CLI_SESSION_ID |
API response format | -f | MGMT_CLI_FORMAT |
For example, on Linux machine use -
export MGMT_CLI_USER=me
export MGMT_CLI_PASSWORD=secret
export MGMT_CLI_MANAGEMENT=1.1.1.1
Then call the Login command -
mgmt_cli login
If you are writing a script to automate your tasks, you can save the password obscured, and then un-obscure in script just before calling the login command.
Robert.