OPNsense Forum

Archive => 18.7 Legacy Series => Topic started by: guest15389 on August 23, 2018, 07:38:36 pm

Title: Monthly Traffic Totals
Post by: guest15389 on August 23, 2018, 07:38:36 pm
The one thing I can't seem to find an easy solution for is something that collects daily/weekly/monthly traffic totals.

I think the only thing I'm missing on stock OPN is the ability to make these fields last day, last week, last month, etc.

(https://i.imgur.com/jE6SjOml.png)

I've been toying around with different things such as vnstat, bandwidthd, darkstat, few different netflow products, but nothing really just does a simple sum. I just want to know what my WAN did for last month.
Title: Re: Monthly Traffic Totals
Post by: Drinyth on September 20, 2018, 03:30:21 pm
+1

I just migrated over from pfsense yesterday and this is one of the things that I'm feel like I'm still missing from the new installation.

For those of us with monthly bandwidth caps, it's nice having the router keep track of how much data has passed through it in the past days and months so we can keep tabs on things and make sure we don't go over our allotted limit.

On the 18.7.3 release notes, it states:

Quote
On the plugin side development for the upcoming WireGuard VPN, ntopng and vnStat plugins continues. Check the forum for further updates.

But in searching for vnstat, I haven't found much of anything? I would love to have vnstat be available for opnsense! Thanks!
Title: Re: Monthly Traffic Totals
Post by: franco on September 20, 2018, 03:41:01 pm
Development plugins are found in the development version (see your firmware settings). If you want to install on a 18.7.3 production system you can do a manual console install:

# pkg install os-vnstat-devel


Cheers,
Franco
Title: Re: Monthly Traffic Totals
Post by: marjohn56 on September 20, 2018, 04:40:11 pm
And it works.  :)
Title: Re: Monthly Traffic Totals
Post by: Drinyth on September 20, 2018, 05:09:39 pm
Development plugins are found in the development version (see your firmware settings). If you want to install on a 18.7.3 production system you can do a manual console install:

# pkg install os-vnstat-devel

I saw that package there this morning when I did a "pkg search vnstat", but I wasn't sure about doing a manual console install of a devel package (which wasn't showing up in the plug-ins from the GUI) while running on a production system. I wasn't sure what changing the version from production to development entailed (i.e. would it also potentially try and update to the bleeding edge base OS)? I wasn't ready to jeopardize the stability of everything else on the firewall just to gather that data.

In any case, it's nice to know that it was a safe option. It's successfully installed and gathering stats.

Thank you for the work that you've put into OPNsense! I've been very pleased with the experience thus far!
Title: Re: Monthly Traffic Totals
Post by: mimugmail on September 20, 2018, 05:14:41 pm
My main motivation when building plugins :)
Title: Re: Monthly Traffic Totals
Post by: marjohn56 on September 20, 2018, 05:43:01 pm
Time for a vnstat widget or is that in the works already?
Title: Re: Monthly Traffic Totals
Post by: mimugmail on September 20, 2018, 06:08:08 pm
I'm not the widget guy, feel free to do mate :)
Title: Re: Monthly Traffic Totals
Post by: Ricardo on November 26, 2018, 06:33:54 pm
Time for a vnstat widget or is that in the works already?

Add me for that vnstat plugin as well. It would be super handy!

Ps. Is the vnstat data preserved across reboots, if /var and /tmp is on volatile tmpfs? I couldnt find anything related to this on the service tab for vnstat.
Title: Re: Monthly Traffic Totals
Post by: mimugmail on November 26, 2018, 07:13:02 pm
Plugin ist already there?
Title: Re: Monthly Traffic Totals
Post by: Ricardo on November 27, 2018, 12:03:42 pm
Plugin ist already there?

Are you asking, or stating? AFAIK there is no vnstat plugin at the moment.
I added myself to the wishlist for a vnstat plugin on the dashboard.
Title: Re: Monthly Traffic Totals
Post by: mimugmail on November 27, 2018, 01:27:06 pm
Which version?

https://forum.opnsense.org/index.php?topic=9716.msg44352#msg44352

18.7.3 was the release ...
Title: Re: Monthly Traffic Totals
Post by: Ricardo on November 27, 2018, 01:31:52 pm
Which version?

https://forum.opnsense.org/index.php?topic=9716.msg44352#msg44352

18.7.3 was the release ...

Sorry, I'm using the word plugin and widget interchangibly. So you are totally correct, vnstat PLUGIN is already available. What we are requesting is the vnstat WIDGET, to show the data on the dashboard.
Sorry for the confusion.
Title: Re: Monthly Traffic Totals
Post by: mimugmail on November 27, 2018, 03:02:25 pm
I never did widgets .. so no idea how this works :/
Title: Re: Monthly Traffic Totals
Post by: Ricardo on November 27, 2018, 04:16:04 pm
So before it gets unanswered in this thread, does anyone know:

Is the vnstat data (=stats) preserved across reboots, if /var and /tmp is on volatile tmpfs? I couldnt find anything related to this on the service tab for vnstat.


Title: Re: Monthly Traffic Totals
Post by: mimugmail on November 27, 2018, 05:15:54 pm
Data gets lost with the current version
Title: Re: Monthly Traffic Totals
Post by: franco on November 27, 2018, 08:40:37 pm
That can be fixed, but to be fair it's properly documented in the /var MFS help text and there are no easy exceptions. Tickets raised usually make this go away. :)


Thanks,
Franco
Title: Re: Monthly Traffic Totals
Post by: Ricardo on November 28, 2018, 08:43:12 am
Thanks mimugmail, franco.

I know the tmpfs is volatile, so I dont care much about data preserved across reboots for most of the stuff. But I know RRD is also generating output into /var andOR /tmp, and to preserve these RRD stats, there is periodic backup option of RRD (and thankfully it can be turned on/off as per need). As I said, for most logs of services I dont really care, but vnstat is used for a very specific reason: to show where I am staying with my monthly traffic cap. There are opnsense updates at least 1-2 times per month, so that would render my stats unusable this case.
That is why I wanted to check with you, if there are any plans to keep those stats survive in case of tmpfs storage.
Title: Re: Monthly Traffic Totals
Post by: franco on November 28, 2018, 01:36:27 pm
As I said I'm happy to work on it in exchange for at ticket:

https://github.com/opnsense/plugins/issues


Cheers,
Franco
Title: Re: Monthly Traffic Totals
Post by: Ricardo on November 28, 2018, 02:59:58 pm
Sure, will do! Thanks very much.
Title: Re: Monthly Traffic Totals
Post by: unipacket on December 13, 2018, 02:45:02 am
Hope you don't mind but I submitted a feature request on github.    :)

https://github.com/opnsense/plugins/issues/1061