Traffic Totals Hourly Report Problem
-
Hello,
I confirm that the hourly report shows more than 2 days (maybe 4).
To return back to 24 hours, I edited (I know I shouldn't edit this file but it's a try) :
/usr/local/etc/vnstat.confto add:
HourlyDays 1
and I restarted the service .You can choose the data retention durations you need
In the file vnstat.conf.sample, it's written:# data retention durations (-1 = unlimited, 0 = feature disabled) 5MinuteHours 48 HourlyDays 4 DailyDays 62 MonthlyMonths 25 YearlyYears -1 TopDayEntries 20
Yann
-
Beware, when you change your settings in traffic totals by the webgui and you save them as defaults, the file vnstat.conf is written again and you loose your data retention durations selection you choosed by editing this file.
If you want to keep your selection or your options, you must edit the file /usr/local/pkg/status_traffic_totals.inc
This one is used to create vnstat.confYann.
-
I'm following along here... Just to clarify. Are the totals recording correctly and it's just a display issue? Are the daily and monthly totals accurate?
-
@wormuths Yes, it's just a display issue. You can check your data with vnstat in the shell. If you decide to change the data retention durations, it will affect your data and not only the display.
-
@YannTKO, thank you very much for figuring a fix for those graphing issues.
-
Can anyone generate a system > patches files.
I am afraid i will really mess something up if I try manually changing files
Thanks
Myk -
Nobody?
-
@pwnell Thank you this fixed my current problem where the hourly graph looked like the first image since I did a fresh install of 2.4.5
-
Yeah, if this is an issue, someone should write up a bug in Redmine (use the pfSense Packages section and the Status Traffic Totals category) and then update the package in Github so everyone can benefit from the change and easily apply a system patch in the meantime. Manually changing files works great until a file you changed is updated, then your change disappears. At least a system patch can be re-applied without re-editing the file.
-
@pwnell said in Traffic Totals Hourly Report Problem:
value.time.hour
Just tried to create a pull request on GitHub what a mess that turned out to be. IF I have time later will try and do something in a non web version but that wasn't easy at all and it was a simple change to fix the hourly display on 2.4.5
-
@virgiliomi said in Traffic Totals Hourly Report Problem:
Yeah, if this is an issue, someone should write up a bug in Redmine (use the pfSense Packages section and the Status Traffic Totals category) and then update the package in Github so everyone can benefit from the change and easily apply a system patch in the meantime. Manually changing files works great until a file you changed is updated, then your change disappears. At least a system patch can be re-applied without re-editing the file.
you can solve this issue by editing the file:
/usr/local/pkg/status_traffic_totals.inc@YannTKO said in Traffic Totals Hourly Report Problem:
Beware, when you change your settings in traffic totals by the webgui and you save them as defaults, the file vnstat.conf is written again and you loose your data retention durations selection you choosed by editing this file.
If you want to keep your selection or your options, you must edit the file /usr/local/pkg/status_traffic_totals.inc
This one is used to create vnstat.confYann.
-
@hulleyrob said in Traffic Totals Hourly Report Problem:
@pwnell said in Traffic Totals Hourly Report Problem:
value.time.hour
Just tried to create a pull request on GitHub what a mess that turned out to be. IF I have time later will try and do something in a non web version but that wasn't easy at all and it was a simple change to fix the hourly display on 2.4.5
It has been already done :
redmine.pfsense.org/issues/10429 -
I have the same issues too... First i thought i was the only one to have issues until i saw this thread :) .. I just installed it and then removed it again when it turned out it was not working properly..
-
@YannTKO said in Traffic Totals Hourly Report Problem:
/usr/local/pkg/status_traffic_totals.inc
guess I am dumb and dont understand what to change in this file, any push in the right direction?
-
@MyKroFt so you are happy to get to the file and edit it on the command line?
I just open it with VI find "value.id" this and the first line that matched was the one in the post above by @pwnell
"var date = Date.UTC(value.date.year, value.date.month-1, value.date.day, value.id);"
then edit value.id to value.time.hour
This fixed the hourly graphs for me which is all I was interested in. Save then quit and refresh the page job done.
-
Editing /usr/local/pkg/status_traffic_totals.inc is just to keep data retention choice.
Editing status_traffic_totals.php is to solve the hourly/10 days graphical issues.
Yann. -
@YannTKO sorry you are correct it was the PHP file I edited, early morning here coffee not kicked in yet.
-
thank you, knowing it was the .php instead of .inc made sense and was able to edit the file
thanks
-
@yanntko said in Traffic Totals Hourly Report Problem:
Editing /usr/local/pkg/status_traffic_totals.inc is just to keep data retention choice.
Editing status_traffic_totals.php is to solve the hourly/10 days graphical issues.
Yann.Thank you for pointing me here.
This thread as started in July and and the problem is stil pending ?
I am in /user/local/pkg but there is no file status_traffic_totals.php
-
huh.. The file you want to edit is
[2.4.5-RELEASE][admin@sg4860.local.lan]/usr/local/www: ls status_traffic_totals.php status_traffic_totals.php [2.4.5-RELEASE][admin@sg4860.local.lan]/usr/local/www:
This looks like it was fixed back in nov
https://github.com/pfsense/FreeBSD-ports/commit/dcb4949cc70f78006d05c662aa81c5849f93d4c0#diff-cbd6e5b8cd0fd83476715c17fdb47eec98bd0b54a6426f7dc7cfaeea141f7a4cBut shows that it should be 2.3.2, but that is not what is being pulled down - only 2.3.1_1
Without looking deeper - my guess would be that 2.3.2 is for 2.5 and not 2.4.5.. I fixed it with simple edit.. So I haven't really spent much time looking..