Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm wondering if there's an API for getting the disk usage, database space usage, or bandwidth utilization of a domain hosted using Virtualmin?

share|improve this question

closed as off-topic by Falcon Momot, womble Oct 9 '15 at 0:47

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

up vote 3 down vote accepted

If it's in the UI, it's in the CLI and API. If it's not, it's probably a bug, and we'll probably fix it if you tell us about it.

You can get a huge amount of information about a domain using the list-domains function:

http://www.virtualmin.com/documentation/developer/cli/list_domains

Specifically, the --multiline mode:

# virtualmin list-domains --domain virtualmin.com --multiline

Will list disk and database usage, as well as a huge number of other values. I'd thought we had a JSON output option on that command...but, I'm not seeing it now, I guess it's still on the todo list. It's not too hard to parse that data, though, as it's just in "Name: Value" format, line separated.

Bandwidth:

http://www.virtualmin.com/documentation/developer/cli/list_bandwidth

All commands are usable from the remote API, as well. You just have to URL-encode your options and wrap them up in a web request. There are examples of that in the docs:

http://www.virtualmin.com/documentation/developer/http

share|improve this answer
    
Excellent! Just what I need. JSON output would be a swell if it was implemented. – FrancisV Jun 16 '11 at 0:53

Not the answer you're looking for? Browse other questions tagged or ask your own question.