vnstat.conf - Man Page

vnStat configuration file

Synopsis

/etc/vnstat.conf

Description

vnstat(1), vnstati(1) and vnstatd(8) all use the same configuration file for configuration related settings. Some of the settings are common for all three programs. The file consists of keyword-argument pairs, one per line. Empty lines and lines starting with '#' or ';' are interpreted as comments and not processed. Arguments may optionally be enclosed in double quotes (") in order to represent arguments containing spaces. Arguments can be padded with spaces or tabulator characters. A hardcoded default value will be used if a keyword can't be found from the configuration file or if the configured value cannot be parsed or is outside supported value range.

The configuration file is divided into three sections based on the usage of each keyword. The first section contains keywords that are considered common for all commands, the second section is for daemon related keywords and the last section is for image output.

Common Keywords

DatabaseDir

Specifies the directory where the database is to be stored. A full path must be given and a leading '/' isn't required.

DayFormat, MonthFormat, TopFormat

Formatting of date in available outputs. Uses the same format as date(1). (vnstat and vnstati only)

DefaultDecimals

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

EstimateBarVisible

Show a visual representation of the traffic estimation if OutputStyle has been configured with a value of 1 or 2 to make the bar column visible. 1 = enabled, 0 = disabled. (vnstat only, see EstimateStyle for vnstati)

EstimateText

Replace default "estimated" text on the estimate line with custom text. Limited to 9 characters. (vnstat and vnstati only)

EstimateVisible

Show a line with traffic estimation for the selected time period or alert as the last line of the output in output modes supporting it. Disabling estimate visibility also disables estimate conditions in --alert. 1 = enabled, 0 = disabled. (vnstat and vnstati only)

HourlyDecimals

Number of decimals to use in hourly graph output. Value range: 0..2 (vnstat only)

HourlySectionStyle

Select what kind of spacer is used for separating the numerical sections of the hourly graph output. 0 = none, 1 = '|', 2 = '][', 3 = '[ ]'. (vnstat only)

Interface

Default interface used when no other interface is specified on the command line. Leave empty for automatic selection. The automatic selection will prioritize the interface with most traffic for outputs doing database queries. Queries not using the database will first check if the database is available and select the interface with most traffic out those that are currently visible in the system. If no database can be read then the first available interface will be used. (vnstat and vnstati only)

InterfaceMatchMethod

Method for matching interface given for a query to an interface in the database.

Method 0 requires the interface name to be a case sensitive exact match. Method 1 extends the previous method by allowing a case sensitive exact match of the interface alias. Method 2 extends the previous method by allowing a case insensitive exact match of the interface alias. Method 3 extends the previous method by allowing a case insensitive match of the beginning of the interface alias.

Methods will be evaluated in the order described above resulting in exact interface matches always taking precedence. If any interface alias matching method results in multiple matches then the interface with the highest total traffic will be used. (vnstat and vnstati only)

List5Mins, ListHours, ListDays, ListMonths, ListYears, ListTop

Number of entries to show in list outputs unless overridden from the command line. Set to 0 to show all entries available in the database. (vnstat and vnstati)

Locale

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)

OutputStyle

Modify the content and style of text outputs. 0 = minimal and narrow output for terminal with limited width, 1 = normal output with bar column visible, 2 = same as 1 except rate is visible in summary output, 3 = rate column is visible in all outputs where it is supported. (vnstat and vnstati only)

QueryMode

Default query mode when no parameters are given. 0 = normal, 1 = days, 2 = months, 3 = top, 5 = short, 6 = years, 7 = hours graph, 8 = xml, 9 = one line, 10 = json, 11 = hours and 12 = 5 minute. (vnstat only)

RateUnit

Select which unit is used when traffic rate is visible. 0 = bytes, 1 = bits. (vnstat and vnstati only)

RateUnitMode

Select used prefix when traffic rate is shown in bits per second. IEC binary prefixes are calculated with powers of 1024. SI decimal prefixes are calculated with powers of 1000. 0 = IEC binary prefixes (Kibit/s...), 1 = SI decimal prefixes (kbit/s...). (vnstat and vnstati only)

RXCharacter, TXCharacter

Character used for representing the percentual share of received and transmitted traffic in list mode outputs. (vnstat only)

RXHourCharacter, TXHourCharacter

Character used for representing the percentual share of received and transmitted traffic in hourly graph output. (vnstat only)

Sampletime

Defines how many seconds the -tr option will sample traffic. Value range: 2..600 (vnstat only)

UnitMode

Select how units are prefixed. IEC and JEDEC binary prefixes are calculated with powers of 1024. SI decimal prefixes are calculated with powers of 1000. 0 = IEC standard prefixes (B/KiB/MiB/GiB...), 1 = old style (JEDEC) binary prefixes (B/KB/MB/GB...), 2 = SI decimals prefixes (B/kB/MB/GB...) (vnstat and vnstati only)

Files

/etc/vnstat.conf

Config file that will be used unless $HOME/.vnstatrc exists or alternative value is given as command line parameter.

Restrictions

Using long date output formats may cause misalignment in shown columns if the length of the date exceeds the fixed size allocation.

Author

Teemu Toivola <tst at iki dot fi>

See Also

vnstat(1), vnstati(1), vnstatd(8), units(7)

Referenced By

vnstat(1), vnstatd(8), vnstati(1).

OCTOBER 2022 version 2.10 User Manuals