-
Notifications
You must be signed in to change notification settings - Fork 120
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
Duplicated Entries #24
Comments
That's some strange behaviour. Few questions:
Assuming the daemon was in use and you don't have a quick log discard, it would be interesting to see what the vnstatd output was around 31.7.2015. That could contain some clues why the duplicates happen. |
Unfortunately I only have syslogs from August which is weird but not related to this. |
I just noticed that I changed the system time on the 31 of July. |
Ok Im pretty sure the duplicated entries are caused by changing the system time. Is there a way to edit the database of vnstat? |
Yes, that indeed appears to be the likely case. Either bad timing with the system time change or changing to a timezone far enough from the previous. I'll have to see if I could come up with some sort of sanity checker that would merge that kind of duplicated days/months when the database is loaded. It's possible to edit the database like this:
If you don't mind, could you show the output of |
Here is the exported database: https://gist.github.com/AlexMl/758a22e8f75673196683 The time change was about 7 or 8 hours if it matters. |
I had time to fix the database today. Thanks for your help. Everything is fine again. m;0;1438380001;81047;4361;897;955;1 What are the last three numbers for? I read the manpage but did not understand it. |
On that line, 897 is the rx KiB value for the current month and 955 is the corresponding tx value. This structure is due to vnStat historical reasons. For getting the rx value in KiB, you'd count 81047 * 1024 + 897 and in a similar way, tx for that line is 4361 * 1024 + 955. The last number is either 0 or 1 depending on whether that line has already been filled by vnStat and it's being shown in outputs. Usually it will show everywhere as 1 if the database has been in use for longer than 11 months. |
It's happening for me too on my OpenWRT router. Sometimes when there's an power outage vnstat get's all messed up and it doubles the entries like in the screenshots above. |
Hopefully the switch to the sqlite database will make this problem go away as I don't have a good understanding how to replicate it in order to better understand what's happening and why. At least based on sqlite's documentation, it should be better at handling partially completed writes that are likely to happen during a power outage. I suspect that's something the filesystem in OpenWRT doesn't do be itself. |
sqlite database implementation has been merged from the branch to master and will be included in vnStat 2.0 release. |
I noticed that vnstat has duplicated entries for some days and months. Look at the pictures I attached.
I run Ubuntu 14.04 with the 3.13.0-61 kernel. The vnstat version is 1.14.
The text was updated successfully, but these errors were encountered: