Retrieve PowerFlex core component logs using REST API
Use the following procedures to collect logs using REST API.
Prerequisites
The
(PFMP) cluster must be present.
The
PowerFlex cluster must be deployed.
The
cluster must be able to communicate with any host instance in the
PowerFlex cluster. To test the connection, ping from a
PowerFlex node to the data IP addresses of the instances.
Ensure that you have mdm_ips, mno_username, mno_password, and mno_ip.
Steps
To log in to M&O, run the following API command:
POST https://<mno_ip>/rest/auth/login
For example:
token=$(curl -k --silent 'https://<mno_ip>/rest/auth/login' --header 'Accept: application/json' --header 'Content-Type: application/json' -d '{"username": "<mno_username>","password": "<mno_password>"}' |jq -r '.access_token'); echo $token
Save the access token received in the output.
To get configuration, run the following API command:
POST https://<mno_ip>/im/types/Configuration/instances
For example:
curl --silent -k -X POST -H "Authorization: Bearer ${token}" -H 'Content-Type: application/json' -d '{ "mdmIps":["10.234.177.103","10.234.177.153"], "mdmUser":<mno_username>, "mdmPassword":"<mno_password>", "securityConfiguration":{ "allowNonSecureCommunicationWithMdm":"false", "allowNonSecureCommunicationWithLia":"false", "disableNonMgmtComponentsAuth":"false" } }' https://<mno_ip>/im/types/Configuration/instances>config.json
Save the output of the request. This output is a JSON representation of the system configuration.
Add the M&O login information to the JSON. The get info script requires the login information to perform certain queries, to provide this information, add the following key value pairs to JSON:
mnoUser : “<mno_username>”
mnoPassword : “<mno_password>”
mnoIp : “<mno_ip>”
For example:
{
“mnoUser” : “<mno_username>” ,
“mnoPassword”: “<mno_password>” ,
“mnoIp: “<mno_ip>”
“snmpIp”: null
… (rest of the json)
}
To collect logs, run the following API command:
POST https://<mno_ip>/im/types/NodeInfo/instances/actions/collectLogs
To run the collect logs request, ensure that you have a valid token and the configuration JSON. For more optional attributes, go to step 7.
curl -k -X POST -H "Authorization: Bearer ${token}" -H 'Content-Type: application/json' -d @config.json https://<mno_ip> /im/types/NodeInfo/instances/actions/collectLogs
To monitor the log collection process, run the following API command:
GET https://<mno_ip>/im/types/ProcessPhase/actions/queryPhaseState
Monitor the
phaseStatus value and wait until the operation is complete.
For example:
curl -s -k -X GET -H "Content-Type:application/json" -H "Authorization: Bearer ${token}" https://<mno_ip> /im/types/ProcessPhase/actions/queryPhaseState
Output example:
{"phaseStatus":"completed","phase":"query","numberOfRunningCommands":0,"numberOfPendingCommands":0,"numberOfCompletedCommands":6,"numberOfAbortedCommands":0,"numberOfFailedCommands":0,"failedCommand
To download the logs, run the following API command:
GET https://<mno_ip>/im/types/NodeInfo/instances
For example:
curl -s -k -i -X GET -H "Content-Type:application/json" -H "Authorization: Bearer ${token}" https://<mno_ip>/im/types/NodeInfo/instances -o "get_info.zip"
In this example, the logs are downloaded to the current working directory under the name "get_info.zip".
(Optional) Add the following optional attributes to the log collection request as query parameters:
targetIPs —Filter the result to only part of the nodes (by their IPs)
copyRepositories —Copy MDM repositories (true/false, default is false)
liteVersion (lite version)—Collect trc.0, exp.0, and umt.0 files only and repository files (true/false, default is false)
copyBinaries —Collect MDM, SDS, SDR, SDT, LIA binaries and core dumps (true/false, default is false)
collectSdbgScreens (true/false, default is false)
For example:
curl -k -X -i POST -H "Content-Type:application/json" -H "Authorization: Bearer ${token}" "https://<mno_ip>/im/types/NodeInfo/instances/actions/collectLogs?copyRepositories=true&targetIPs=10.55.118.61&targetIPs=10.55.118.62"
To clear the operation and move to idle, run the following API commands:
POST https://<mno_ip>/im/types/Command/instances/actions/clear
https://<mno_ip>/im/types/ProcessPhase/actions/moveToIdlePhase
After the log collection operation is complete, mark the completed operation as completed to allow the other jobs to run.
For example:
curl -s -k -X POST -H "Content-Type:application/json" -d '{}' -H "Authorization: Bearer ${token}" https://<mno_ip>/im/types/Command/instances/actions/clear
curl -s -k -X POST -H "Content-Type:application/json" -d '{}' -H "Authorization: Bearer ${token}" https://<mno_ip>/im/types/ProcessPhase/actions/moveToIdlePhase
Data is not available for the Topic
All fields are required unless marked otherwise.
Comments cannot contain these special characters: <>()\
Sorry, our feedback system is currently down. Please try again later.
Thank you for your feedback.