How do I restore the vnstat.db file, I can't get the stats to reappear when I reinstalled it. all blank
keep saying
Error: Failed to get info value for "dbversion" from database (11): database disk image is malformed
Error: Failed to open database "/opt/var/lib/vnstat/vnstat.db" in read-only mode.
Tried uninstalling it and starting for scratch and now it says this:
Error: Interface "eth0" not found in database.
This sounds like an incomplete/improper set-up. To answer your questions specifically, it depends on whether you are on R1 or R2. For R2, all you need to do is copy the sqlite db,
a hidden file called .vnstatusage
CORRECTION :
/opt/var/lib/vnstat/vnstat.db
assuming you're on USB, otherwise this file in on JFFS. The location of that file depends on whether you store it in jffs (addons/dn-vnstat.d folder) or usb (opt/share/dn-vnstat.d folder). If you're on R1 you may be out of luck, but try to remove the install, save the data when prompted, then re-install. If the data still is readable, it should pick it up automatically. It may be worth trying an export of the data if you're on R1 - see the instructions on the github landing page.
Hello all,
I have a secondary router (AC68u router mode) connected to my main router (AC86u router mode) and installed vnstat on the AC68u to hopefully track the usage only for users connected to it.
When setting up it asked if my default interface on the AC68u was vlan2, is this correct? I know on the main router it was eth0. I ask because I essentially am only using this to track neighbors who need to connect to this router via its guest wifi while keeping it isolated from my main network.
Thanks
It depends on your setup. If it is just a downstream router with no other setup then eth0 should be correct. You could try each setting and see what is recorded. Usually the script is good about picking the right interface and the AC86u was one of the routers tested.
yes I get daily usage. Oh sorry I've set it to 8th, my bad. Monthly image shows (01) for other months, does that mean it was set to start day 1 or what does (01) in bracket mean?
View attachment 35474
For this and the next two issues: the date in parens is the monthly start date of statistics. The behavior of
vnstat
(the linux app, not the Merlin add-on) is that the data collection date re-starts on the month following the change in start date (see
here). In my (our) R2 testing differing behavior between R1 and R2 was not observed, but I will go back and re-test this weekend.
Hi - my ISP data resets on 14th of evry month. I have 14 set on VNSTAT day of month but its not resetting stats. Using latest version 2.0 and 386.3.2 on AC86U
Is data still being shown in the previous month, or not recorded at all? Is your router date and time correct? Since this was a couple of days back, is it still not recording in the correct month?
@Jack Yaz , not sure if what I'm seeing is similar or different manifestation to
@Khadanja or
@joe scian.
If you recall a couple of pages back I noted that after upgrade to 2.0, and after re-setting my "rollover" day to Day 14, I was still seeing (01) instead of (14) in the stats for the monthly totals. From what I can tell the actual "amounts" are correct, and it DID reset last night (Sydney time), so it's purely a display error, but maybe it's linked to what the others are seeing.
I was waiting for the "new" month to rollover in case it corrected itself, but today they are all still saying (01).
I think you were going to look at whether a manual "fudge" on the database could be done to "make it look right" but maybe the issue goes deeper?
I'll look at this over the weekend. Again, I didn't test day 14 in R2. It could be that in R2 that type of display is deprecated, in which case we'll just remove it, but let's see.
Sorry for the delay in reading the recent posts. Last couple of weeks at a new job have been crazy with tech issues and I had some Home Assistant work that also required attention. Technology!