Skip to content

Commit

Permalink
increase default data retention durations
Browse files Browse the repository at this point in the history
  • Loading branch information
vergoh committed May 1, 2018
1 parent f0964a8 commit 21de369
Show file tree
Hide file tree
Showing 4 changed files with 58 additions and 51 deletions.
10 changes: 9 additions & 1 deletion CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,15 @@
- Data rate calculations when using SI decimal prefixes
- New
- C struct dump database has been replaced with sqlite database
- User configurable data retention durations for all resolutions
- User configurable data retention durations for all resolutions with
following changed defaults:
v1.8 v2.0
5 minutes n/a 576
hours 24 96
days 30 60
months 12 24
years n/a all
top days 10 20
- Option to select units to use SI decimal prefixes using calculations
with powers of 1000 (IEC and JEDEC prefixes use powers of 1024)
- Yearly and 5 minute resolution statistics
Expand Down
8 changes: 4 additions & 4 deletions cfg/vnstat.conf
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ MaxBWethnone 8

# data retention durations (-1 = unlimited, 0 = feature disabled)
5MinuteHours 48
HourlyDays 2
DailyDays 30
MonthlyMonths 12
HourlyDays 4
DailyDays 60
MonthlyMonths 24
YearlyYears -1
TopDayEntries 10
TopDayEntries 20

# how often (in seconds) interface data is updated
UpdateInterval 30
Expand Down
80 changes: 40 additions & 40 deletions man/vnstat.conf.5
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ daemon related keywords and the last section is for image output.

.SH COMMON KEYWORDS

.TP
.B 5MinuteHours
Data retention duration for the 5 minute resolution entries. The configuration
defines for how many past hours entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B DatabaseDir
Specifies the directory where interface databases are to be stored.
Expand All @@ -47,25 +40,11 @@ Formatting of date in available outputs. Uses the same format as
.BR date (1).
(vnstat and vnstati only)

.TP
.B DailyDays
Data retention duration for the one day resolution entries. The configuration
defines for how many past days entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B DefaultDecimals
Number of decimals to use in outputs. Value range: 0..2
(vnstat and vnstati only)

.TP
.B HourlyDays
Data retention duration for the one hour resolution entries. The configuration
defines for how many past days entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B HourlyDecimals
Number of decimals to use in hourly output. Value range: 0..2
Expand Down Expand Up @@ -94,13 +73,6 @@ Locale setting to be used for prints. This replaces the LC_ALL
environment variable. Set to "-" or leave empty in order to use the
system default value. (vnstat and vnstati only)

.TP
.B MonthlyMonths
Data retention duration for the one month resolution entries. The configuration
defines for how many past months entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B OutputStyle
Modify the content and style of text outputs. 0 = minimal and
Expand Down Expand Up @@ -143,13 +115,6 @@ and transmitted traffic in hourly output. (vnstat only)
Defines how many seconds the \-tr option will sample traffic.
Value range: 2..600 (vnstat only)

.TP
.B TopDayEntries
Data retention duration for the top day entries. The configuration
defines how many of the past top day entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B UnitMode
Select how units are prefixed. IEC and JEDEC binary prefixes are calculated
Expand All @@ -158,15 +123,15 @@ with powers of 1024. SI decimal prefixes are calculated with powers of 1000.
binary prefixes (B/KB/MB/GB...), 2 = SI decimals prefixes (B/kB/MB/GB...)
(vnstat and vnstati only)

.SH DAEMON RELATED KEYWORDS

.TP
.B YearlyYears
Data retention duration for the one year resolution entries. The configuration
defines for how many past years entries will be stored. Set to -1 for
.B 5MinuteHours
Data retention duration for the 5 minute resolution entries. The configuration
defines for how many past hours entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.SH DAEMON RELATED KEYWORDS

.TP
.B BandwidthDetection
Try to automatically detect
Expand Down Expand Up @@ -230,6 +195,20 @@ The user can either be the login of the user or a numerical user id.
Leave empty to disable the user switch. This option can only be used when
the process is started as root.

.TP
.B DailyDays
Data retention duration for the one day resolution entries. The configuration
defines for how many past days entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B HourlyDays
Data retention duration for the one hour resolution entries. The configuration
defines for how many past days entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B LogFile
Specify log file path and name to be used if UseLogging is set to 1.
Expand All @@ -247,6 +226,13 @@ for selected interfaces. The name of the interface is specified directly
after the MaxBW keyword without spaces. For example MaxBWeth0 for eth0
and MaxBWppp0 for ppp0. Value range: 0..50000

.TP
.B MonthlyMonths
Data retention duration for the one month resolution entries. The configuration
defines for how many past months entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B MonthRotate
Day of month that months are expected to change. Usually set to
Expand Down Expand Up @@ -291,6 +277,13 @@ in systems without a real-time clock (RTC) which require some time after boot
to query and set the correct time. 0 = wait disabled.
Value range: 0..60

.TP
.B TopDayEntries
Data retention duration for the top day entries. The configuration
defines how many of the past top day entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.TP
.B TrafficlessDays
Log days without any traffic to daily list. 1 = enabled, 0 = disabled.
Expand All @@ -317,6 +310,13 @@ How often in seconds the interface data is updated. Value range:
.B UseLogging
Enable or disable logging. 0 = disabled, 1 = logfile and 2 = syslog.

.TP
.B YearlyYears
Data retention duration for the one year resolution entries. The configuration
defines for how many past years entries will be stored. Set to -1 for
unlimited entries or to 0 to disable the data collection of this
resolution.

.SH IMAGE OUTPUT RELATED KEYWORDS

.TP
Expand Down
11 changes: 5 additions & 6 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,17 +172,16 @@ and most can be changed later from the config file.
#define LISTTOP 10
#define LISTJSONXML 0

/* TODO: are these defaults suitable for most users or too short?
how to handle upgrades and avoid discarding data if the
/* TODO: how to handle upgrades and avoid discarding data if the
package maintainer provided configuration has shorter retention
than what user has configured? */
/* data retention defaults */
#define FIVEMINUTEHOURS 48
#define HOURLYDAYS 2
#define DAILYDAYS 30
#define MONTHLYMONTHS 12
#define HOURLYDAYS 4
#define DAILYDAYS 60
#define MONTHLYMONTHS 24
#define YEARLYYEARS -1
#define TOPDAYENTRIES 10
#define TOPDAYENTRIES 20

/* assume that locale can be UTF-n when enabled */
#define UTFLOCALE 1
Expand Down

0 comments on commit 21de369

Please sign in to comment.