Usage summary via API

3 posts / 0 new
Last post
#1 Mon, 12/10/2012 - 05:30
chriswik

Usage summary via API

I would like to get a usage summary for a VM via the API, similar to what is displayed under Edit System -> Resource Usage in the Web UI.

So far I have found list-systems with --multiline but with this I cannot specify my own period, only current, last or N periods ago.

I also found the list-usage command which does accept a user specified period, but I can't figure out how to get a summary of the data.

Thanks in advance for any pointers.

Mon, 12/10/2012 - 13:16
JamieCameron

You may want to try the list-usage command - it can give you day by day breakdowns for any time period.

''

Mon, 12/10/2012 - 15:07
chriswik

What I'm looking for is the GB/hours for memory and disk, allocated CPU percent hours, and number of GB transferred over a specified period. list-systems with --multiline gives me that info but only for the current or any previous calendar month.

OK, found the solution at http://www.virtualmin.com/documentation/cloudmin/usage

"The accounting period over which usage is display is the same one used for bandwidth monitoring, set at Cloudmin Settings -> Bandwidth Monitoring."

I had not realized that we could change the overall accounting period by changing the bandwidth monitoring period. If we change that to Day we can get the daily totals from the list-systems command.

So I found it in the end, but perhaps you could consider making this a little more intuitive, for example moving the setting from Bandwidth Monitoring to Cloudmin Configuration?

Topic locked