Submitted by SoftDux on Mon, 08/01/2011 - 10:37
Hi,
Is it possible that CloudMin could generate and email total bandwidth usage for the whole month, on a per VPS basis?
CloudMin currently sends out an email once a VPS goes over it's limit, so even if this code could be extended a bit to send a final email on the first day of the next month, giving a total bandwidth usage for the previous month.
I want to suggest that maybe one could select that all VM's bandwidth usage gets emailed, or only over-usage VM's, or none (for those who don't want this feature) and perhaps on a per-VM basis as well. For example, Bob's VM doesn't go over-usage but he still wants a usage email at the end of the month
Status:
Active
Comments
Submitted by JamieCameron on Mon, 08/01/2011 - 13:59 Comment #1
This sounds like something you could script yourself using the Cloudmin API .. for example, you can get the bandwidth usage over the current period with a command like :
cloudmin list-systems --host vps.whatever.com --multiline | grep "Bandwidth usage towards limit"
It should be possible to write a small shell script to generate this kind of email report.
Also, the command
cloudmin list-bandwidth
can display usage on a day-by-day basis..Submitted by SoftDux on Mon, 08/01/2011 - 14:06 Comment #2
Hi Jamie,
I thought of doing that but thought many others will also find this useful. And I think it would be more "elegant" if it's part of CloudMin than being "hacked into it".
Submitted by JamieCameron on Mon, 08/01/2011 - 15:41 Comment #3
Maybe .. but I want to avoid feature overload. We have an API so that these kinds of features can be relatively easily implemented by users.
I would consider adding this if a few more people ask about it though :-)
Submitted by Lucian on Wed, 08/03/2011 - 09:25 Comment #4
+1 for avoiding feature overload, cloudmin already tries to do too much, imho ... People need to get more familiar with the cloudmin api and exploit it better.
Submitted by SoftDux on Wed, 08/03/2011 - 09:32 Comment #5
Lucian in this very instance the API is a bit limited and we're forced to develop additional scripts to take care of this core feature (IMO). I don't want to have virtualmin bloated, but keeping track of bandwidth usage is (hopefully?) a very important part for any hosting company
Submitted by Lucian on Wed, 08/03/2011 - 17:26 Comment #6
Softdux, agreed. The good solution here would be the API getting a bit better reporting this kind of stuff. Ideally the API should be so good that a good web dev could create a functional, fancy web 3.0 interface by only using it.
Submitted by JamieCameron on Wed, 08/03/2011 - 18:16 Comment #7
To make collection of bandwidth usage in the past simpler, I will update the
list-systems
API command to allow use of theperiod-ago
flag to show bandwidth usage for the previous accounting period (month, week or whatever). This will be in the next Cloudmin release.Also, the
list-bandwidth
API command can output an hour-by-hour breakdown of usage by host, which you could then sum up any way you like ..