Comments (13)
From the TODO list:
everything gets currently stored forever
Nice! I would love to see hourly statistics from years gone by.
from vnstat.
sqlite database implementation has been merged from the branch to master and will be included in vnStat 2.0 release. Data retention is user configurable.
from vnstat.
The current database structure has a fixed size and it doesn't support (well) changing the duration of data being stored to it. I don't either have any plans on modifying the current structure as upgrades between structure changes have proved to cause problems far too easily.
However, I have a separate branch (https://github.com/vergoh/vnstat/tree/sqldb) in (slow) development which uses sqlite as database and will eventually replace the currently used solution. That's planned to allow users to have better control on the period and resolution being stored to the database.
from vnstat.
Just a quick status update:
The sqldb branch has seen good development recently and from a feature point of view, all data can already be stored in the database forever when configured to do so (and disk space permits), including the new 5 minute precision statistics. I'm currently working on getting all the outputs working in the same way as in 1.x versions and then plan to proceed on adding some way of querying more specific time ranges.
from vnstat.
I wanted to ask something about the sqldb branch. Can you maybe make a tool or something that would allow to export information from current database to the sqldb? Because of the limits of current database I'm making monthly backups to keep all the data. I would appreciate a way to to export data from multiple 1.x databases to one 2.x database.
from vnstat.
That might be a little bit too case specific to be included in vnStat itself and that data is likely to contain some duplication that shouldn't get imported.
I assume it's the daily data that you'd like to get import and possibly also older months? It probably shouldn't be too hard to write a script to run vnstat --exportdb
to those 1.x databases one by one using an older vnstat
binary and then inject the data directly to the sqlite database.
from vnstat.
I already have those data exported as part of the backup script I wrote. I just need a way to import them to the new database from the oldest one to the newest to assure the survival of as much data as possible. The files are named by date.
from vnstat.
Just to clarify, does your backup script export the data with --exportdb
or something else?
The import order itself shouldn't really matter as long as the exported data has a timestamp available. The database stores all the data using the timestamp this time instead of a round robin like indexing used in 1.x versions.
from vnstat.
Yes, it's using --exportdb as backup method and then it compresses it into .tar.gz.
I can upload you an example if you'd like.
from vnstat.
Something like this should do the trick if executed for every exported v1.x database: https://gist.github.com/vergoh/1619965f1132fda3412b1031c822be1e
from vnstat.
Yes, I think that would be perfect. I will try it when you'll be ready to release a stable version of vnstat 2.0 or at least a beta. Thanks.
from vnstat.
Hi,
thanks for providing the conversation script. It spared me some work ;). I had to adapt the indices of the data fields to get the expected results:
rx = int(c[3])10241024 + int(c[5])*1024
tx = int(c[4])10241024 + int(c[6])*1024
Regards
hmw
from vnstat.
rx = int(c[3])*1024*1024 + int(c[5])*1024
tx = int(c[4])*1024*1024 + int(c[6])*1024
Right, my bad for not really testing that it did was was intended. Fixed now also in the previously provided link.
from vnstat.
Related Issues (20)
- Traffic rate for * higher than set maximum HOT 6
- reference to vnstat-server in offical page in vnstat related section HOT 2
- vnstatd 2.9, kernel "NULL pointer dereference" HOT 3
- Is vnstati based on other charting software ? If so, which one ? HOT 1
- BUILD FAIL: configure cannot guess build type HOT 1
- Wrong date if you want to track the daily use HOT 5
- Pfsense retention HOT 1
- vnstat: no longer works after databases/sqlite3 disabled DQS HOT 2
- Database size growing at alarming rate. Best ways to curb it? HOT 18
- Vnstat virtual interface not appearing HOT 7
- New VLANs not discovered HOT 2
- 95th percentile bandwidth calculation HOT 18
- wrong stat data for some interface HOT 17
- Calculate Traffic when vnstat stopped! HOT 4
- how to recover the database when i modify the time and updae the database force HOT 2
- How to install latest version? HOT 6
- Publish to snap store HOT 7
- vnstat measures file sharing from one device to another as transmission HOT 3
- How to install vnstat 2.9+ on Debian Bookworm. HOT 4
- Wireguard interface disabled, can't enable HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vnstat.