OPNsense Forum

English Forums => General Discussion => Topic started by: zuperman on March 23, 2017, 01:51:58 pm

Title: Traffic Stats
Post by: zuperman on March 23, 2017, 01:51:58 pm
Hi,
I haven't really found a satisfying solution yet with OPNSense, but how can I quickly see the traffic/bandwith usage on a daily, monthly and hourly basis?

IPFire has a simple and nice on based on vnstat, pfsense introduced something similar (but not so fancy) - and OPNSense..?

I do not need detailes statistics on hosts, IPs, ports etc.
Simply on my WAN interfaces.
Title: Re: Traffic Stats
Post by: slick on March 18, 2018, 01:29:56 pm
Hello,

A year ago this was made and not a single reply, vnstat (vnstati) like statistics would make this firewall even better imo.

+1

maybe there should be a pool who wants this implemented
Title: Re: Traffic Stats
Post by: phoenix on March 18, 2018, 01:41:03 pm
What's wrong with using an external solution where you can get the results in the format you want? You can do that with the Telegraf plug-in sending the data to Grafana and then building your own graphs, I do.
Title: Re: Traffic Stats
Post by: bartjsmit on March 18, 2018, 01:46:14 pm
You can do that with the Telegraf plug-in sending the data to Grafana and then building your own graphs.

Hi Bill,

That would make a great addition to the Tutorials and FAQ section of the forum

Bart...
Title: Re: Traffic Stats
Post by: slick on March 18, 2018, 01:51:14 pm
What's wrong with using an external solution where you can get the results in the format you want? You can do that with the Telegraf plug-in sending the data to Grafana and then building your own graphs, I do.

Hello,

Thanks for your reply, there is nothing wrong with exporting data and using external devices, but why can this be done in one device? why there has to be something on top of something doing something to get what people ask for and want? this is not the first request here to have in-house per month/day/week stats.

Thanks
Title: Re: Traffic Stats
Post by: sudzee on June 20, 2018, 09:00:27 am
+1

Just moved from pfsense to opnsense.  Been lurking the project since the fork.  Its been an impressive amount of work.  Good job and thanks to all those involved.

I have installed vnstat with a gui on my setup - its pretty much duct taped on.

I installed the vnstat package from the official repo, configured/restored dbs from pfsense backup.
Grabbed a copy of https://github.com/bjd/vnstat-php-frontend  named it vnstat and put it in /usr/local/www/

https://192.168.x.1/vnstat
(https://i.imgur.com/SJSkhzbm.png) (https://i.imgur.com/SJSkhzb.png)


This bypasses authentication!


Id imagine this puts a nice big gaping security risk on the web server as unauthenticated php is running on the otherwise carefully secured opnsense webserver.  I would definitely not use this if I was accessing the front end:443 from WAN.

I find the risk bearable for myself on this network but would love to see an official plugin.

I might poke around os-helloworld plugin but thats a very a big might right now and Im not sure I've got the chops.
Title: Re: Traffic Stats
Post by: marjohn56 on June 20, 2018, 12:25:00 pm
Have a look at the first few lines of index.php in your vnstat folder.


You'll see this:


Code: [Select]
    require 'config.php';
    require 'localize.php';
    require 'vnstat.php';


Edit it so it looks like this:


Code: [Select]
    require_once("/usr/local/www/guiconfig.inc");
    require 'config.php';
    require 'localize.php';
    require 'vnstat.php';


Now try going directly to the pages without logging in first.
Title: Re: Traffic Stats
Post by: sudzee on June 20, 2018, 07:45:35 pm
Have a look at the first few lines of index.php in your vnstat folder.
....

Code: [Select]
    require_once("/usr/local/www/guiconfig.inc");....

works like a charm.  Cheers!

(https://i.imgur.com/1SJpEKhm.png) (https://i.imgur.com/1SJpEKh.png)