VNSTATI(1)
π
vnstati(1) β image output support for vnStat β¨
okay bestie, this is the vnstati(1) page from User Manuals, and itβs literally the glow-up era for your traffic stats π
πΈ NAME πΈ
vnstati β image output support for vnStat
β¨ SYNOPSIS β¨
vnstati [-5bcdDehiLmosStvy?] [--95th mode] [-5g [limit] [height]]
[--altdate] [--begin date] [--cache time] [--common-width] [--config
file] [--days [limit]] [--db file] [--dbdir directory] [--dbiflist
[mode]] [--debug] [--end date] [--fivegraph [limit] [height]]
[--fiveminutes [limit]] [--font file[:size]|size] [--headertext text]
[--help] [-hg [mode]] [--hours [limit]] [--hoursgraph [mode]] [-hs
[graph]] [--hsummary [graph]] [-i interface] [--iface interface] [-ic
[mode]] [--invert-colors [mode]] [--large] [--limit limit] [--locale
locale] [--months [limit]] [-ne] [-nh] [-nl] [--noedge] [--noheader]
[--nolegend] [--output file] [-ru [mode]] [--rateunit [mode]] [--scale
percent] [--small] [--style number] [--summary] [--top [limit]]
[--transparent [enabled]] [--version] [-vs [graph]] [--vsummary [graph]]
[interface]
π¦ DESCRIPTION π¦
The whole point of vnstati is to give you image output support for the statistics collected using vnstat(1). π The available image file formats depend on whatβs supported by the used GD library. All basic outputs of vnStat are supported, excluding live traffic features. The image can be outputted either to a file or to standard output, with the latter being limited to png image format.
π OPTIONS π
--95th modeβ shows the 95th percentile output graph for the ongoing month. This output uses the 5 minute resolution data of the ongoing month to calculate the 95th percentile traffic rate for received, transmitted, or total as selected using the mandatorymodeparameter. The 95th percentile will be shown as a horizontal line in the graph, with the exact 95th percentile traffic rate visible in the legend section of the image. In addition, a one hour resolution traffic rate bar graph averaged from the 5 minute resolution data of the selected mode is presented. This output requires the5MinuteHoursconfiguration option to have a value of at least744for storing all the necessary data, otherwise 100% coverage isnβt possible. Available modes:0= received,1= transmitted,2= total. π--altdateβ uses an alternative date and time text location. The date and time text gets moved from the upper right header section to the lower left corner. This option has no effect if-nh,--noheaderhas been selected.-b,--begin dateβ begins the list output with a specific date / time defined bydateinstead of the begin being selected based on the number of entries to be shown. Ifdateisnβt available in the database, then the closest later date will be used.datesupports the following formats:YYYY-MM-DD HH:MM,YYYY-MM-DD, and"today". This option can only be used with list outputs.-c,--cache timeβ updates the output file only if at leasttimeminutes have passed since the previous file update. This option is ignored if stdout is used as output.--common-widthβ uses a common image width for summary (-s), list (-d/-m/-t/-y), hourly graph (-hg), and 5 minute graph (-5g) outputs based on the active font metrics. Narrower outputs are padded; list bars may grow or shrink slightly and the 5 minute graph sample count is chosen to match. When enabled, the optionallimitgiven to-5gis ignored for width calculation. Can also be enabled withCommonWidthin the configuration file. Useful when vertical alignment of multiple images is needed. π«Ά--config fileβ usesfileas configuration file instead of using automatic configuration file search functionality. If--configis used multiple times, the configuration settings from files later on the command line will override configuration settings loaded from earlier files if the settings defined in the files overlap.-d,--days [limit]β outputs traffic statistics on a daily basis for the last days. The length of the list will be limited to30entries unless configured otherwise or unless the optionallimitparameter is used. All entries stored in the database will be shown iflimitis set to0.--db fileβ usesfileas database file instead of searching for a database from the directory specified in the configuration file or the hardcoded default if no configuration file is available. This option overrides--dbdir.--dbdir directoryβ usesdirectoryas database directory instead of using the directory specified in the configuration file or the hardcoded default if no configuration file is available. This option is ignored if--dbis also defined.--dbiflist [mode]β lists interfaces currently in the database. Ifmodeis not defined or is set to0, then the output will use a one line verbose format. Ifmodeis set to1, then the output will contain one interface per line, and ifmodeis set to2, then only the interface count will be shown as a single number. See also--iflist.-D,--debugβ shows additional debug output. Can be used multiple times for increased verbosity up to a maximum of2.-e,--end dateβ ends the list output with a specific date / time defined bydateinstead of the latest date / time in the database. Ifdateisnβt available in the database, then the closest earlier date will be used.datesupports the following formats:YYYY-MM-DD HH:MMandYYYY-MM-DD. This option can only be used with list outputs. The top list also requires--beginto be used at the same time with this option.-5g,--fivegraph [limit] [height]β outputs traffic statistics with a 5 minute resolution for the last48hours using a bar graph. The width of the graph can be modified using the optionallimitparameter, which represents the number of 5 minute entries with12entries for each hour. The smallest supported value is288(last 24 hours). Additionally, the height of the graph can be modified using the optionalheightparameter. The smallest supported height is150pixels. π-5,--fiveminutes [limit]β outputs traffic statistics with a 5 minute resolution for the last hours. The length of the list will be limited to24entries unless configured otherwise or unless the optionallimitparameter is used. All entries stored in the database will be shown iflimitis set to0.--font file[:size]|sizeβ uses a TrueType font file for image text, optionally setting point size. A baresizevalue (digits only) overrides the configuredFontSizewhile keepingFontFile.libGDmust provide FreeType support and the font file must be readable. π€--headertext textβ showstextin the image header section instead of automatically generated interface identification.textis limited to64characters and may not get completely shown if longer than the width of the image. Use with--altdateif maximal space is needed. This option has no effect if-nh,--noheaderhas been selected.-h,--hours [limit]β outputs traffic statistics on a hourly basis. The length of the list will be limited to24entries unless configured otherwise or unless the optionallimitparameter is used. All entries stored in the database will be shown if thelimitis set to0.-hg,--hoursgraph [mode]β outputs traffic statistics on a hourly basis for the last24hours using a bar graph. The optionalmodeparameter can be used to override the configuration file setting. Available modes:0= 24 hour sliding window,1= graph begins from midnight. π-hs,--hsummary [graph]β outputs traffic summary with the graph selected using theSummaryGraphsetting in the configuration file next to it using a horizontal layout. The optionalgraphparameter can be used to override the configuration file setting. Available graphs:0= hours,1= 5 minutes.-i,--iface interfaceβ usesinterfaceinstead of default or configured interface. It is also possible to merge the information of two or more interfaces using theinterface1+interface2+...syntax. All provided interfaces must be unique and must exist in the database when the merge syntax is used. Optionally, depending on theInterfaceMatchMethodconfiguration setting,interfacecan be replaced with alias previously set usingvnstat --setalias. Merge syntax isnβt supported when alias is used. The-i,--ifaceoption is optional andinterfacecan be used as parameter on the command line for selecting the used interface even without the option being explicitly used. π-ic,--invert-colors [mode]β inverts image colors. Results in black becoming white, dark colors becoming light, light colors becoming dark, and white becoming black. The optionalmodeparameter can be used to change the color inversion behaviour. Available modes:0= no color inversion,1= invert all colors except those used for rx and tx,2= invert all colors. Whenmodeisnβt specific, mode1will be used.-L,--largeβ uses large fonts in output. When a TrueType font is selected with--fontorFontFile, this multiplies the font size by1.5.--limit limitβ sets the maximum number of shown entries in list outputs tolimit. Usage of--limitoverrides the default list entry limit values and the optionallimitparameter given directly for a list query. All entries stored in the database will be shown iflimitis set to0.--locale localeβ useslocaleinstead of using the locale setting specified in the configuration file or the system default if no configuration file is available.-m,--months [limit]β outputs traffic statistics on a monthly basis for the last months. The length of the list will be limited to12entries unless configured otherwise or unless the optionallimitparameter is used. All entries stored in the database will be shown iflimitis set to0.-ne,--noedgeβ removes darker edges from around the image.-nh,--noheaderβ removes header containing title and update time. Time of the previous update will still be visible in the lower right corner using a less visible color.-nl,--nolegendβ yeets the legend out of the image. You know the one β that little rx/tx colour-mapping key? Gone. Bye. π«Ά-o,--outputfile β writes the image to file and then dips out (exits). The image format is picked from the file extension you give it, so if you name it"image.png"you get png because of the.pngat the end. And honestly? png is the moment β usually the smallest file size without losing any detail or sneaking in compression artifacts π . Bonus: if you pass"-"as file, the output goes to stdout instead, and png image format is used in that case.-ru,--rateunit[mode] β swaps the configured rate unit. Rate set to show in bytes? Now it's bits. Rate set to show in bits? Now it's bytes. Flip mode activated β¨. Alternatively you can pass mode as0or1to pick bytes (0) or bits (1) regardless of whatever the configuration file says β main character energy, ignoring the config entirely.--scalepercent β scales the output to the given percent, which literally just means your image ends up smaller or bigger than the default size.-S,--smallβ small fonts in the output. tiny. adorable. readable. π--stylenumber β changes the content and style of outputs. Set number to3and you get the average traffic rate shown in all outputs where that's supported. Any other value shows bar graphics instead.-s,--summaryβ outputs the traffic statistics summary. the classic. the icon. π-t,--top[limit] β outputs the all-time top traffic days. The list is limited to 10 entries unless it's configured otherwise, or unless you use the optional limit parameter. Set limit to0and every entry stored in the database gets shown. Use it with--beginand optionally with--endand the list is generated from the daily data instead of separate top entries β and just so you know, the availability of daily data is what defines the boundaries that the date-specific query can access. no cap. ποΈ--transparent[enabled] β toggles background colour transparency, depending on theTransparentBgsetting in the configuration file. Or pass0or1as the enabled parameter to disable (0) or enable (1) transparency regardless of what the configuration file says. choose your own adventure fr fr.-v,--versionβ shows the current version.-vs,--vsummary[graph] β outputs the traffic summary with the graph selected by theSummaryGraphsetting in the configuration file below it, in a vertical layout. The optional graph parameter overrides the configuration file setting. Available graphs:0= hours,1= 5 minutes. π¦-y,--years[limit] β outputs traffic statistics on a yearly basis for the last years. The list shows all entries by default unless it's configured otherwise or unless you use the optional limit parameter. Set limit to0and all entries stored in the database get shown too.-?,--helpβ shows a command option summary. the "wait what was that flag again" saviour π
πΈ FILES πΈ
/var/lib/vnstat/β the default database directory on Linux. On BSD systems the compile-time default is/var/db/vnstatunless somebody overrode it at build time.
Configuration file locations and search order? That whole saga is described in vnstat.conf(5). go read it bestie, it's giving essential lore π
β¨ EXAMPLES β¨
vnstati -s -i eth0 -o /tmp/vnstat.png
Outputs traffic summary for interface eth0 to file /tmp/vnstat.png.
vnstati -vs -i eth0+eth1+eth2 -o /tmp/vnstat.png
Outputs traffic summary with hourly data under the normal summary, for a merge of interfaces eth0, eth1 and eth2, to file /tmp/vnstat.png. merging interfaces is so iconic π
vnstati -h -c 15 -o /tmp/vnstat_h.png
Outputs hourly traffic statistics for the default interface to file /tmp/vnstat_h.png β but only if that file hasn't been updated within the last 15 minutes. cache check, slay.
vnstati -d -ne -nh -o -
Outputs daily traffic statistics for the default interface to standard output (stdout), without displaying the header section and without the edges.
vnstati -m --config /home/me/vnstat.cfg -o -
Outputs monthly traffic statistics for the default interface specified in configuration file /home/me/vnstat.cfg to standard output (stdout).
π«Ά RESTRICTIONS π«Ά
Heads up, bestie β read this before you blame yourself.
Depending on the built-in fonts the GD library provides, not all characters may end up shown correctly when a UTF-8 locale is used. Configuring a Unicode capable TrueType font with FontFile or --font avoids this limitation for rendered UTF-8 text. so set the font and let it cook π
Using long date output formats may cause misalignment or clipping in the shown columns if the length of the date exceeds the fixed size allocation. the columns have a size limit and the date is not respecting it π
Scaling an image when background transparency is enabled may not result in transparency being retained. that's just the vibe check it fails, ngl π
π AUTHOR π
Teemu Toivola <tst at iki dot fi>
π SEE ALSO π
vnstat(1), vnstatd(8), vnstat.conf(5), units(7)
and that's the whole page, bestie β this was vnstati(1), version 2.14, dated OCTOBER 2026 π go make some pretty graphs, you absolute icon. periodt. β¨π
π¦ where this page comes from
- arch rolling: vnstat 2.14-1 Β· GPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms