I am running the bandwidth query command but I am not sure how to interpret the data:
I'm pretty sure it's returning the right data and I can parse using PHP but let's say I want to get the bandwidth for the current month; which number would that be and I assume this is in bytes?:
I tried converting those numbers without the quotes into GB by multiplying by 1,073,741,824 but this doesn't seem to match up or even close to the bandwidth data in the Bandwidth Usage section in WHM. Is someone able to explain this?
API Doc for reference: Return cPanel account's bandwidth usage report · cPanel & WHM Developer Portal
Code:
uapi --user=user Bandwidth query grouping='year_month' protocols='http|imap|smtp|pop3|ftp' --output=jsonpretty
JSON:
{
"module" : "Bandwidth",
"result" : {
"status" : 1,
"warnings" : null,
"metadata" : {},
"data" : {
"1612155600" : 459031956,
"1614574800" : 219154161,
"1609477200" : 122039871,
"1601524800" : 114754161,
"1606798800" : 68911489,
"1604203200" : 125230028
},
"messages" : null,
"errors" : null
},
"func" : "query",
"apiversion" : 3
}
API Doc for reference: Return cPanel account's bandwidth usage report · cPanel & WHM Developer Portal