1VNSTATI(1)                       User Manuals                       VNSTATI(1)
2
3
4

NAME

6       vnstati - image output support for vnStat
7
8

SYNOPSIS

10       vnstati [-5bcdDehiLmosStvy?]  [-5g [limit] [height]] [--altdate] [--be‐
11       gin date] [--cache time] [--config file] [--days [limit]] [--dbdir  di‐
12       rectory]   [--debug]   [--end   date]  [--fivegraph  [limit]  [height]]
13       [--fiveminutes  [limit]]  [--headertext  text]  [--help]  [-hg  [mode]]
14       [--hours  [limit]]  [--hoursgraph  [mode]]  [-hs  [graph]]  [--hsummary
15       [graph]] [-i interface] [--iface interface] [--large]  [--limit  limit]
16       [--locale  locale]  [--months  [limit]]  [-ne]  [-nh]  [-nl] [--noedge]
17       [--noheader] [--nolegend]  [--output  file]  [-ru  [mode]]  [--rateunit
18       [mode]] [--scale percent] [--small] [--style number] [--summary] [--top
19       [limit]] [--transparent [enabled]] [--version] [-vs  [graph]]  [--vsum‐
20       mary [graph]] [--months [limit]] [interface]
21
22

DESCRIPTION

24       The  purpose  of vnstati is to provide image output support for statis‐
25       tics collected using vnstat(1).  The available image file  formats  de‐
26       pend  on what is supported by the used GD library. All basic outputs of
27       vnStat are supported excluding live traffic features. The image can  be
28       outputted  either to a file or to standard output, with the later being
29       limited to png image format.
30
31

OPTIONS

33       --altdate
34              Use alternative date and time text location. The date  and  time
35              text  will  be  moved from the upper right header section to the
36              lower left corner. This option will have no effect if -nh, --no‐
37              header has been selected.
38
39
40       -b, --begin date
41              Begin  the  list  output  with a specific date / time defined by
42              date instead of the begin being selected based on the number  of
43              entries  to  be  shown.  If date isn't available in the database
44              then the closest later date will be  used.   date  supports  the
45              following  formats:  YYYY-MM-DD  HH:MM,  YYYY-MM-DD and "today".
46              This option can only be used with list outputs.
47
48
49       -c, --cache time
50              Update output file only if at least  time  minutes  have  passed
51              since the previous file update. This option is ignored if stdout
52              is used as output.
53
54
55       --config file
56              Use file as configuration file instead of using  automatic  con‐
57              figuration file search functionality.
58
59
60       -d, --days [limit]
61              Output  traffic  statistics  on a daily basis for the last days.
62              The length of the list will be limited to 30 entries unless con‐
63              figured  otherwise  or  unless  the  optional limit parameter is
64              used. All entries stored in the database will be shown if  limit
65              is set to 0.
66
67
68       --dbdir directory
69              Use  directory as database directory instead of using the direc‐
70              tory specified in the configuration file or  the  hardcoded  de‐
71              fault if no configuration file is available.
72
73
74       -D, --debug
75              Show additional debug output.
76
77
78       -e, --end date
79              End  the list output with a specific date / time defined by date
80              instead of the latest date / time in the database. If date isn't
81              available  in the database then the closest earlier date will be
82              used.  date supports the following formats: YYYY-MM-DD HH:MM and
83              YYYY-MM-DD.  This option can only be used with list outputs. The
84              top list also requires --begin to be used at the same time  with
85              this option.
86
87
88       -5g, --fivegraph [limit] [height]
89              Output  traffic  statistics  with  a 5 minute resolution for the
90              last 48 hours using a bar graph. The width of the graph  can  be
91              modified using the optional limit parameter which represents the
92              number of 5 minute entries with 12 entries for  each  hour.  The
93              smallest  supported  value is 288 (last 24 hours). Additionally,
94              the height of the graph  can  be  modified  using  the  optional
95              height parameter. The smallest supported height is 150 pixels.
96
97
98       -5, --fiveminutes [limit]
99              Output  traffic  statistics  with  a 5 minute resolution for the
100              last hours.  The length of the list will be limited  to  24  en‐
101              tries  unless  configured otherwise or unless the optional limit
102              parameter is used. All entries stored in the  database  will  be
103              shown if limit is set to 0.
104
105
106       --headertext text
107              Show  text in image header section instead of automatically gen‐
108              erated interface identification.  text is limited to 64  charac‐
109              ters  and  may not get completely shown if longer than the width
110              of the image. Use with --altdate if  maximal  space  is  needed.
111              This  option will have no effect if -nh, --noheader has been se‐
112              lected.
113
114
115       -h, --hours [limit]
116              Output traffic statistics on a hourly basis. The length  of  the
117              list  will  be limited to 24 entries unless configured otherwise
118              or unless the optional limit  parameter  is  used.  All  entries
119              store in the database will be shown if the limit is set to 0.
120
121
122       -hg, --hoursgraph [mode]
123              Output  traffic  statistics  on  a  hourly basis for the last 24
124              hours using a bar graph.  The optional  mode  parameter  can  be
125              used  to  override  the  configuration  file  setting. Available
126              modes: 0 = 24 hour sliding window, 1 = graph  begins  from  mid‐
127              night.
128
129
130       -hs, --hsummary [graph]
131              Output  traffic summary with the graph selected using the Summa‐
132              ryGraph setting in the configuration file next  to  it  using  a
133              horizontal  layout.  The optional graph parameter can be used to
134              override the configuration file setting. Available graphs:  0  =
135              hours, 1 = 5 minutes.
136
137
138       -i, --iface interface
139              Use  interface instead of default or configured interface. It is
140              also possible to merge the information of two or more interfaces
141              using the interface1+interface2+...  syntax. All provided inter‐
142              faces must be unique and must exist in  the  database  when  the
143              merge  syntax  is  used. Optionally, depending on the Interface‐
144              MatchMethod configuration setting,  interface  can  be  replaced
145              with alias previously set using vnstat --setalias.  Merge syntax
146              isn't supported when alias is used. The -i,  --iface  option  is
147              optional  and  interface can be used as parameter on the command
148              line for selecting the used interface even  without  the  option
149              being explicitly used.
150
151
152
153       -L, --large
154              Use large fonts in output.
155
156
157       --limit limit
158              Set  the  maximum  number  of  shown  entries in list outputs to
159              limit.  Usage of --limit overrides the default list entry  limit
160              values  and  the  optional  limit parameter given directly for a
161              list query. All entries stored in the database will be shown  if
162              limit is set to 0.
163
164
165       --locale locale
166              Use  locale instead of using the locale setting specified in the
167              configuration file or the system  default  if  no  configuration
168              file is available.
169
170
171       -m, --months [limit]
172              Output  traffic  statistics  on  a  monthly  basis  for the last
173              months. The length of the list will be limited to 12 entries un‐
174              less configured otherwise or unless the optional limit parameter
175              is used. All entries stored in the database  will  be  shown  if
176              limit is set to 0.
177
178
179       -ne, --noedge
180              Remove darker edges from around the image.
181
182
183       -nh, --noheader
184              Remove header containing title and update time. Time of the pre‐
185              vious update will still be visible in the lower right corner us‐
186              ing a less visible color.
187
188
189       -nl, --nolegend
190              Remove  legend  containing  rx  and tx color mapping information
191              from the image.
192
193
194       -o, --output file
195              Write image to file and exit. The used image format is  selected
196              by  the  given file extension of file.  For example, "image.png"
197              results in the file getting written using the png  image  format
198              due to the ".png" extension having been used. Usage of png image
199              format usually results in the smallest file size without loss of
200              detail  or introduction of compression artifacts. Alternatively,
201              output can be directed to stdout by giving "-" as file in  which
202              case png image format is used.
203
204
205       -ru, --rateunit [mode]
206              Swap the configured rate unit. If rate has been configured to be
207              shown in bytes then rate will be shown in bits if this option is
208              present.  In  the  same  way,  if rate has been configured to be
209              shown in bits then rate will be shown in bytes when this  option
210              is  present.  Alternatively, mode with either 0 or 1 can be used
211              as parameter for this option in order to  select  between  bytes
212              (0) and bits (1) regardless of the configuration file setting.
213
214
215       --scale percent
216              Scale  output  to given percent resulting in the image being ei‐
217              ther smaller or larger than the default size.
218
219
220       -S, --small
221              Use small fonts in output.
222
223
224       --style number
225              Modify the content and style of outputs.  Setting  number  to  3
226              will  show  average traffic rate in all outputs where it is sup‐
227              ported.  Other values will show bar graphics instead.
228
229
230       -s, --summary
231              Output traffic statistics summary.
232
233
234       -t, --top [limit]
235              Output all time top traffic days. The length of the list will be
236              limited  to 10 entries unless configured otherwise or unless the
237              optional limit parameter is used.  All  entries  stored  in  the
238              database  will  be  shown  if  limit is set to 0. When used with
239              --begin and optionally with --end, the list  will  be  generated
240              using  the  daily  data  instead  of  separate top entries.  The
241              availability of daily data defines the boundaries the date  spe‐
242              cific query can access.
243
244
245       --transparent [enabled]
246              Toggle  background color transparency depending of the Transpar‐
247              entBg setting in the configuration file. Alternatively, 0  or  1
248              can  be  given  as parameter enabled for this option in order to
249              either disable (0) or enable (1) transparency regardless of  the
250              configuration file setting.
251
252
253       -v, --version
254              Show current version.
255
256
257       -vs, --vsummary [graph]
258              Output  traffic summary with the graph selected using the Summa‐
259              ryGraph setting in the configuration file below it using a  ver‐
260              tical  layout. The optional graph parameter can be used to over‐
261              ride the configuration  file  setting.  Available  graphs:  0  =
262              hours, 1 = 5 minutes.
263
264
265       -y, --years [limit]
266              Output  traffic statistics on a yearly basis for the last years.
267              The list will show all entries by default unless configured oth‐
268              erwise  or  unless the optional limit parameter is used. All en‐
269              tries stored in the database will also be shown if limit is  set
270              to 0.
271
272
273       -?, --help
274              Show a command option summary.
275
276

FILES

278       /var/lib/vnstat/
279              Default database directory.
280
281
282       /etc/vnstat.conf
283              Config file that will be used unless $HOME/.vnstatrc exists. See
284              vnstat.conf(5) for more information.
285
286

EXAMPLES

288       vnstati -s -i eth0 -o /tmp/vnstat.png
289              Output traffic summary  for  interface  eth0  to  file  /tmp/vn‐
290              stat.png.
291
292
293       vnstati -vs -i eth0+eth1+eth2 -o /tmp/vnstat.png
294              Output traffic summary with hourly data under the normal summary
295              for a merge of interfaces eth0, eth1 and eth2 to  file  /tmp/vn‐
296              stat.png.
297
298
299       vnstati -h -c 15 -o /tmp/vnstat_h.png
300              Output  hourly  traffic statistics for default interface to file
301              /tmp/vnstat_h.png if the file has not been  updated  within  the
302              last 15 minutes.
303
304
305       vnstati -d -ne -nh -o -
306              Output  daily  traffic  statistics without displaying the header
307              section and edges for default interface to standard output (std‐
308              out).
309
310
311       vnstati -m --config /home/me/vnstat.cfg -i -o -
312              Output  monthly  traffic statistics for default interface speci‐
313              fied in configuration file /home/me/vnstat.cfg to standard  out‐
314              put (stdout).
315
316

RESTRICTIONS

318       Depending  on  the  built-in  fonts provided by the GD library, not all
319       characters may end up shown correctly when a UTF-8 locale is used.
320
321       Using long date output formats may cause misalignment in shown  columns
322       if the length of the date exceeds the fixed size allocation.
323
324       Scaling an image when background transparency is enabled may not result
325       in transparency being retained.
326
327

AUTHOR

329       Teemu Toivola <tst at iki dot fi>
330
331

SEE ALSO

333       vnstat(1), vnstatd(8), vnstat.conf(5), units(7)
334
335
336
337version 2.9                      JANUARY 2022                       VNSTATI(1)
Impressum