How to check CPM Usage in version 2.7
Background:
This How-To guide provide details about checking the usage of the CPM Server,
It shows examples of how to get usage from the CPM UI and rest API
- For additional information about the CPM UI, please check our User Guide Link: Backup & Recovery- User Guide_ 2.7.0
- For additional information about Rest API, read our Guide: Link: RestAPI 1.3 Guide
Getting usage from the UI
There are few ways to get a csv usage report from the User interface.
1. The first option is to simply click on the link at the bottom of the UI:
This will download a Usage report for all users.
2. Another option is to click on the report Tab, This will take you to the report area
From here we can generate an immediate report, We can filter it by User, Time and select detailed or not.
We can also schedule the same report so it will be send automatically by email
This are all the options to download or schedule the usage report from the CPM UI
Getting Usage from RestAPI
There are 4 API related to the usage report:
You can call the RestAPI via postman, python and so on,
In this example i will show how to call the account usage report (14.6 in above image) via curl command in linux.
1. First you need to enable the RestAPI in the UI and get the access_key
2. now that it is enabled, we need to call the obtain token API
This will retrieve access_token to be used in followup API calls (full details on access_keys/token can be found in the RestAPI guide)
API_KEY='cpm_api_key'
HOST='CPM_Host'
curl -k -X POST https://%24host/api/token/obtain/api_key/ -H 'Accept: application/json; version=1.1.0' -H 'Authorization: Bearer $TOKEN' -H 'Content-Type: application/json' -d '{"api_key": "'"$API_KEY"'"}' | jq
We will save the access token to a variable for easy access
ACCESS_TOKEN='the_access_token'
Now we can call the usage API, we will call the api with a parameter of account_name=general
curl -k -X GET "https://%24host/api/reports/usage/?account_name=general" -H "Accept: application/json;" -H "Authorization: Bearer ${ACCESS_TOKEN}" | jq
Results:
The API contains other parameters as well, and there are 3 more related API as mentioned before,
Full details about them can be found in the RestAPI guide shared at the start of this How-To.
Thanks for reading this guide,
N2WS Support Team.
Related Articles
How to Check for AWS Permissions
Each account in N2WS is mapped to a specific Roles or IAM user in AWS, You can see the list of account and authentication types in the Account Tab: For each account, you can select it and then click on 'Check AWS Permissions' This will test the ...
Release notes for the latest v4.0.x CPM release
First time Installing? Watch the ' Install and Configure N2WS Backup & Recovery ' video tutorial created by our solution architect: https://n2ws.com/support/video-tutorials/install-and-configure-n2ws-backup-recovery-3-0 For upgrade instructions ...
Release notes for the latest v3.1.x CPM release
In order to upgrade to version 3.1.x from 2.4.x/2.5.x/2.6.x , please see the instructions here: https://support.n2ws.com/portal/kb/articles/upgrade-instructions-for-v3-x In addition, If you are using VSS Agents, after the latest version is installed, ...
Permission check may fail with the error "User not found", if CPM was deployed using CloudFormation
Permission check may fail with the error "User not found", if CPM was deployed using CloudFormation. This could be seen in policy permissions check CSV file: (log bundle/policy_check_AWSDEVTEST.csv example) Error Evaluating Permissions for account ...
cpmdata volume disk usage growth due to binlog
Background: In version 4.2.x, we have upgraded MySQL DB from version 5 to version 8, this changed the default parameter that determines how many binlog file to keep from 10 days to 30 days. This might result in increase in the size the MySQL DB take ...