You are not logged in.

#1 2019-06-30 16:18:43

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

[Solved] vnstat tun0 [disabled] ???

With a fresh install and the imminent arrival of the end of the month, I have been checking the setup for vnstat and noticed that, even though it appears to be recording data for the interface, it is also reporting it as disabled.

+$ vnstat -i tun0
Database updated: 2019-06-30 16:35:00

   tun0 [disabled] since 2019-06-14

          rx:  2.99 GiB      tx:  108.75 MiB      total:  3.09 GiB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       2019-06      2.99 GiB |  108.75 MiB |    3.09 GiB |   10.36 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated      3.02 GiB |  108.76 MiB |    3.12 GiB |

   daily
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     yesterday    740.36 MiB |   19.33 MiB |  759.69 MiB |   73.76 kbit/s
         today     19.35 MiB |    1.77 MiB |   21.12 MiB |    2.97 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated     28.01 MiB |    2.56 MiB |   30.57 MiB |
+$ 
$ vnstat -5 -i tun0

 tun0 [disabled]  /  5 minute

         time        rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     2019-06-30
         14:40      1.22 KiB |       884 B |    2.08 KiB |       56 bit/s
         14:45    317.30 KiB |   52.92 KiB |  370.23 KiB |   10.11 kbit/s
         14:50     16.96 KiB |    4.20 KiB |   21.15 KiB |      577 bit/s
         14:55    180.49 KiB |   27.48 KiB |  207.97 KiB |    5.68 kbit/s
         15:00    855.41 KiB |   97.34 KiB |  952.75 KiB |   26.02 kbit/s
         15:05    138.53 KiB |   31.26 KiB |  169.79 KiB |    4.64 kbit/s
         15:10      1.73 KiB |    1.92 KiB |    3.65 KiB |       99 bit/s
         15:15    528.12 KiB |   47.07 KiB |  575.19 KiB |   15.71 kbit/s
         15:20      8.62 MiB |  334.97 KiB |    8.95 MiB |  250.24 kbit/s
         15:25    524.04 KiB |   80.20 KiB |  604.23 KiB |   16.50 kbit/s
         15:30    900.67 KiB |   83.99 KiB |  984.65 KiB |   26.89 kbit/s
         15:35      2.55 KiB |    3.28 KiB |    5.83 KiB |      159 bit/s
         15:40      1.37 KiB |    1.01 KiB |    2.38 KiB |       64 bit/s
         15:45     12.99 KiB |   14.07 KiB |   27.06 KiB |      738 bit/s
         15:50    264.75 KiB |   56.64 KiB |  321.39 KiB |    8.78 kbit/s
         15:55      1.74 KiB |    1.43 KiB |    3.17 KiB |       86 bit/s
         16:00      8.12 KiB |    3.78 KiB |   11.90 KiB |      324 bit/s
         16:05      1.58 KiB |    1.28 KiB |    2.86 KiB |       78 bit/s
         16:10      1.29 KiB |       908 B |    2.18 KiB |       59 bit/s
         16:15    779.60 KiB |   69.70 KiB |  849.29 KiB |   23.19 kbit/s
         16:20     33.11 KiB |   14.39 KiB |   47.50 KiB |    1.30 kbit/s
         16:25    227.27 KiB |   30.59 KiB |  257.86 KiB |    7.04 kbit/s
         16:30    142.30 KiB |   25.04 KiB |  167.35 KiB |    4.57 kbit/s
         16:35    112.25 KiB |   21.49 KiB |  133.73 KiB |    3.65 kbit/s
     ------------------------+-------------+-------------+---------------
+$ 

In comparison,

+$ vnstat -i wlp2s0
Database updated: 2019-06-30 16:55:00

   wlp2s0 since 2019-06-14

          rx:  3.28 GiB      tx:  309.07 MiB      total:  3.58 GiB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       2019-06      3.28 GiB |  309.07 MiB |    3.58 GiB |   11.97 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated      3.31 GiB |  311.46 MiB |    3.61 GiB |

   daily
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     yesterday    808.69 MiB |   59.00 MiB |  867.69 MiB |   84.24 kbit/s
         today     24.00 MiB |    4.93 MiB |   28.93 MiB |    3.98 kbit/s
     ------------------------+-------------+-------------+---------------
     estimated     34.05 MiB |    6.99 MiB |   41.04 MiB |
+$ 
+$ vnstat -5 -i wlp2s0

 wlp2s0  /  5 minute

         time        rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
     2019-06-30
         15:00    969.07 KiB |  215.18 KiB |    1.16 MiB |   32.34 kbit/s
         15:05    183.65 KiB |   88.96 KiB |  272.61 KiB |    7.44 kbit/s
         15:10      5.56 KiB |    7.07 KiB |   12.63 KiB |      344 bit/s
         15:15    596.46 KiB |  114.92 KiB |  711.37 KiB |   19.43 kbit/s
         15:20      9.32 MiB |  857.43 KiB |   10.16 MiB |  284.05 kbit/s
         15:25    630.05 KiB |  194.73 KiB |  824.78 KiB |   22.52 kbit/s
         15:30      0.98 MiB |  191.72 KiB |    1.17 MiB |   32.70 kbit/s
         15:35      8.49 KiB |   11.24 KiB |   19.72 KiB |      538 bit/s
         15:40      5.03 KiB |    5.93 KiB |   10.96 KiB |      299 bit/s
         15:45     22.73 KiB |   27.38 KiB |   50.11 KiB |    1.37 kbit/s
         15:50    327.68 KiB |  126.49 KiB |  454.17 KiB |   12.40 kbit/s
         15:55      6.24 KiB |    7.24 KiB |   13.49 KiB |      368 bit/s
         16:00     13.55 KiB |   11.36 KiB |   24.91 KiB |      680 bit/s
         16:05      5.36 KiB |    6.49 KiB |   11.85 KiB |      323 bit/s
         16:10      5.23 KiB |    6.04 KiB |   11.27 KiB |      307 bit/s
         16:15    877.86 KiB |  167.71 KiB |    1.02 MiB |   28.55 kbit/s
         16:20     58.29 KiB |   43.48 KiB |  101.77 KiB |    2.78 kbit/s
         16:25    264.42 KiB |   72.05 KiB |  336.47 KiB |    9.19 kbit/s
         16:30    170.62 KiB |   58.25 KiB |  228.87 KiB |    6.25 kbit/s
         16:35    142.88 KiB |   56.39 KiB |  199.27 KiB |    5.44 kbit/s
         16:40     97.63 KiB |   31.85 KiB |  129.48 KiB |    3.54 kbit/s
         16:45     31.42 KiB |   17.13 KiB |   48.55 KiB |    1.32 kbit/s
         16:50     18.28 KiB |   12.91 KiB |   31.19 KiB |      851 bit/s
         16:55      5.18 KiB |    6.02 KiB |   11.20 KiB |      305 bit/s
     ------------------------+-------------+-------------+---------------
+$ 

tun0 is definitely active,

+$ vnstat --iflist
Available interfaces: lo enp3s0 tun0 (10 Mbit) wlp2s0 
+$ 

and I rechecked that i had enabled it with

+$ vnstat --add -i tun0
Error: Interface "tun0" already exists in the database.
+$ 

As I remember, /var/lib/vnstat/ used to hold separate database files for each interface, and many problems of this nature could be resolved by deleting the offending file. Now, however, it seems there is only a single db file(?)

Could somebody please explain what is going on?

Irvine

Last edited by IrvineHimself (2019-06-30 21:05:50)


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

#2 2019-06-30 20:50:03

Vergo
Member
Registered: 2019-04-24
Posts: 2

Re: [Solved] vnstat tun0 [disabled] ???

That's a bug that was fixed 5 days ago: https://github.com/vergoh/vnstat/commit … cfbfd8e5de

The fix isn't yet included in a released version. However, the only issue is the interface staying marked as "disabled" even when it's available and correctly being monitored.

Regarding the database directory content:
In versions 1.x the databases were in reality C struct dumps which limited feature configurability and several other things due to the static nature of the solution. Starting from version 2.0, there's only a single SQLite database file containing the data for all interfaces. It should be far more resilient to error situations and, by design, fix those many problems seen with the older files.

Offline

#3 2019-06-30 21:05:17

IrvineHimself
Member
From: Scotland
Registered: 2016-08-21
Posts: 275

Re: [Solved] vnstat tun0 [disabled] ???

Thank you for that, and many thanks for a much loved utility. smile

Irvine


Et voilà, elle arrive. La pièce, le sous, peut-être qu'il arrive avec vous!

Offline

Board footer

Powered by FluxBB