Introduction
As an administrator, it is often important to take stock of resources on a server. When hosting reseller accounts, it can be time consuming to do so via the UI, since it must be acquired on a per-reseller basis, one at a time.
The API also only pulls data for one account, but from command line provides more flexibility in the use of bash.
Procedure
The command to acquire report for one account would be:
# whmapi1 resellerstats user="steve"
---
data:
reseller:
acct: []
bandwidthlimit: 0
bwoverselling: 0
diskoverselling: 0
diskquota: 0
diskused: 0
month: 3
totalbwalloc: 0
totalbwused: 0
totaldiskalloc: 0
user: steve
year: 2021
metadata:
command: resellerstats
reason: OK
result: 1
version: 1
The user "steve" being my example here.
To find report for all resellers, we need to do a for-loop to run the command for all of the resellers on the server:
# for i in `cat /var/cpanel/resellers | awk -F: '{ print $1 }'` ; do whmapi1 resellerstats user="$i"; echo "" ; done
---
data:
reseller:
acct:
-
bandwidthlimit: '0.00'
bandwidthused: '0.00'
deleted: 0
diskquota: 0
diskused: '1.71'
domain: owned.tld
package: default
suspended: ~
user: owned
bandwidthlimit: 0
bwoverselling: 0
diskoverselling: 0
diskquota: 0
diskused: '1.71'
month: 3
totalbwalloc: 0
totalbwused: 0
totaldiskalloc: 0
user: reseller
year: 2021
metadata:
command: resellerstats
reason: OK
result: 1
version: 1
---
data:
reseller:
acct: []
bandwidthlimit: 0
bwoverselling: 0
diskoverselling: 0
diskquota: 0
diskused: 0
month: 3
totalbwalloc: 0
totalbwused: 0
totaldiskalloc: 0
user: steve
year: 2021
metadata:
command: resellerstats
reason: OK
result: 1
version: 1
[
Comments
0 comments
Article is closed for comments.