Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get traffic bandwidth on wan interface #20

Closed
mcodo opened this issue Jan 7, 2018 · 2 comments
Closed

Get traffic bandwidth on wan interface #20

mcodo opened this issue Jan 7, 2018 · 2 comments

Comments

@mcodo
Copy link

mcodo commented Jan 7, 2018

Hi
Is there a way to get the consumed speed on wan interface like the data we get under Status -> Traffic Graph?
Bandwidth In and Bandwidth Out

Thanks

@ndejong
Copy link
Owner

ndejong commented Jan 21, 2018

Hi mcodo -

This is probably a nice feature request actually, I'll keep the ticket open until implemented.

In the mean time I've taken a look through pfSense code to figure out where this data is actually coming from in the underlaying system for which there is an interesting exec call made by pfSense in bandwidth_by_ip.php - see below:-

$_grb = exec("/usr/local/bin/rate -i {$real_interface} -nlq 1 -Aba 20 {$sort_method} {$ratesubnet} | tr \"|\" \" \" | awk '{ printf \"%s:%s:%s:%s:%s\\n\", $1,  $2,  $4,  $6,  $8 }'", $listedIPs);

I expect you'll be able to use /usr/local/bin/rate to get the data you are looking for.

@ndejong
Copy link
Owner

ndejong commented Jul 2, 2018

Following up on this

A new function interface_stats has been added that partly answers your requirement here, the issue however is that the way bandwidth usage is computed in the pfSense GUI in these graphs under Status -> Traffic is via client side javascript that computes rates based on the cumulative total bytes that pfSense provides underneath.

In short, you can achieve the same effect but you'll have to do the same as the pfSense GUI does by polling (fauxapi) and computing the bandwidth rates you are looking for.

Release 1.3 due shortly

N

@ndejong ndejong closed this as completed Jul 2, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants