Bandwidth usage and bandwidth monitoring


I’m still trying to find out how to enable bandwidth usage and bandwidth monitoring, providing these features are available on Virtualmin GPL.

By bandwidth usage I mean the ability to check how much GB of data has been transferred in/out during a certain period of time.

And by bandwidth monitoring I mean the ability to set alerts (interface and/or emails) when certain threshold has been reached. For instance, if I assign 50 GB of monthly data transfer to a specific domain and it has used 80%, etc, already during that month.

Thank you!


Take a peek at System Settings -> Bandwidth Monitoring, does that do what you’re after?

Monitoring should be enabled by default, but you can setup alerts to notify you whenever certain threshholds have been reached.


Thanks for your reply, andreychek.

I can’t believe I didn’t see that menu before.

It was disabled on my server, so I guess it is not enabled by default:

Bandwidth monitoring active? -> No

I have switched it to Yes, to start monitoring bandwidth on this server.

Thanks again!

Well… it worked fine the first day I enabled de Bandwidth Monitoring:

Limit: 2 TB
Usage: 479.58 GB

But it has not been updated ever since.

Any idea on which button to push now to make it work on a daily and monthly basis? :slight_smile:

It should launch a “” process from cron which calculates all the bandwidth information… if you look at root’s crontab, do you see an entry there to run


Thanks for your reply. :slight_smile:

Yes, I can see this entry:

root Yes /etc/webmin/virtual-server/

What else should I double check? Perhaps a feature I have disabled (or not enabled) on the server or for this specific virtualhost?

It’s weird to know it worked the first time, when I enabled monitoring, but it didn’t continue to work properly.

You might want to check your syslog and similar, to see if the cron job throws any errors. It should also mention that it is being run at the configured interval in the syslog.

Oh, and a little hint for Eric/developers. A few days ago I started doing some file hosting on my server. Before that time I had no need for bandwidth monitoring, but now I do, so I started looking into that topic.

First, I was a bit confused about the terminology. “Bandwidth” in my view refers to “network speed”, measured e.g. in “kBit per second”. You rather use it as “total traffic consumed by transfers”. It’s okay once you know what it is called, but just saying that at first I thought the feature was for limiting network speed that a domain can use to say 50 MBit/s of a 100 MBit line. :slight_smile: (And I was astonished how Virtualmin was going to accomplish that.)

Then a cosmetic/comfort thing. It’d be nice to have a button to display the bandwidth usage graph in a more prominent place. Right now I need to go to Virtualmin/System Settings/Bandwidth Monitoring and click “Show Usage Graph” there.

And while are at it, a more prominent way to force on-the-spot creation to AWStats report would also be nice. Right now I need to select the domain and go to Logs and Reports/AWstat config, then click “Return to list of reports”, there click the domain in question, where I finally find the “Generate Report Now” button. :smiley:

I’ll get back to Locutus’s point in a bit :slight_smile:

But just going over the bandwidth calculations here – what happens if you run that script manually, as root:


Do you see any errors? And does running it manually cause the stats to be updated?


Hi Locutus,

plus 1 to your suggestions.

And in regards to my issue:

I checked syslog and found this line in there:

Aug 15 19:00:01 host /USR/SBIN/CRON[17729]: (root) CMD (/etc/webmin/virtual-server/

And no error messages related to it either before or after that line.

I wonder if this issue has anything to do with my current settings:

Bandwidth monitoring active? Yes
Hours between collection: 1
Accounting period: Last 30 days
Number of days to keep bandwidth data: Default

The way I understand these settings is that they will be refreshed every 1 hour, so I can check and see the bandwidth usage every hour. Is that right?

And the “Accounting period” is kind of a mystery to me.

Hi andreychek,

Executed that command, no errors:

root@host ~ # /etc/webmin/virtual-server/
root@host ~ #

I can see the value is slightly different now (491.02 GB), when compared to previous one (479.58 GB).

Now, I cannot tell if this higher value is because of running this command or it was like that before. I just forgot to check first the current value prior to executing that command. I’m sorry.

The thing is that datacenter is reporting usage of way more than 2 TB, from their own bandwidth monitoring tool they provide to customers.

When I first installed Webmin/Virtualmin, the bandwidth monitoring seemed to be working. A couple of weeks later when I need these numbers for billing, I’m getting the “No bandwidth usage statistics have been collected yet.” error message. The command runs manually without errors, and I’ve placed it in root’s crontab. When I try to change the accounting period to monthly for 365 days, it doesn’t save the 365 value. The page refreshes with that value blank.

Can I use this to check the bandwidth monitoring bandwidth usage for users OpenVPN and SSH tunneling ?
I use centos and have installed Virtualmin gpl and I have activated the bandwidth monitoring in Virtualmin. But bandwidth usage still 0 byte.
I use openvz and I opened ports 443, 143, 8080 and 80
I just turn Administration user and home directory on Features and Plugins Virtualmin.