Installing munin-node
on your servers and configuring a munin
server will get you graphical output by interface per machine. Resolution of the data is fixed at five minute intervals. As noted, data for current bandwidth resolution is not available as such. It needs to be derived by sampling counters over time. Utilization is derived from (actual delta) / (rate * period).
Munin will gather a bunch of other information which can be useful when tracing bottlenecks and other problems. It can also be configured to alarm when values stray outside configured limits.
EDIT: If you want the latest values, you could write a script that will extract the lastest sample from the rrd file(s). This would be for the latest 5 minute sample.
Unfortunately, bandwidth usage is not tracked directly. If you need relatively instantaneous readings you will need to query the counters, wait some period of time, and query the counters again. You could then calculate the bandwidth usage. You could use munin-node
to query the counters. The command to fetch the counters is fetch ip_eth0
. The config data contains the baseline data for full utilization. The shorter the period you wait, the higher the error you will get in your sample.