vnstat in 2.4.5 not showing current month


  • I have upgraded to pfSense 2.4.5 and with the new vnstat 2.4 I no longer see the current month:

    [2.4.5-RELEASE][root@fw-pwn.XXX.lan]/var/db/vnstat: /usr/local/bin/vnstat -m -i em1
    
     WAN (em1)  /  monthly
    
            month        rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
           2019-04    556.50 GiB |    9.84 MiB |  556.51 GiB |    1.84 Mbit/s
           2019-05    763.17 GiB |   38.88 MiB |  763.21 GiB |    2.45 Mbit/s
           2019-06    427.58 GiB |   12.80 MiB |  427.59 GiB |    1.42 Mbit/s
           2019-07    678.50 GiB |   29.45 GiB |  707.95 GiB |    2.27 Mbit/s
           2019-08    561.71 GiB |   34.04 GiB |  595.75 GiB |    1.91 Mbit/s
           2019-09    849.14 GiB |   48.70 GiB |  897.84 GiB |    2.98 Mbit/s
           2019-10    604.19 GiB |   89.23 GiB |  693.42 GiB |    2.22 Mbit/s
           2019-11    703.15 GiB |   89.27 GiB |  792.43 GiB |    2.63 Mbit/s
           2019-12    665.11 GiB |  113.59 GiB |  778.70 GiB |    2.50 Mbit/s
           2020-01    575.35 GiB |  128.82 GiB |  704.17 GiB |    2.26 Mbit/s
           2020-02    467.61 GiB |  101.51 GiB |  569.12 GiB |    1.95 Mbit/s
           2020-03    267.42 GiB |   67.84 GiB |  335.26 GiB |    1.08 Mbit/s
         ------------------------+-------------+-------------+---------------
         estimated    698.89 GiB |  177.28 GiB |  876.17 GiB |
    

    Note that the counter for 2020-03 is updating - so it is accumulating April's data. Time on pfSense is correct:

    [2.4.5-RELEASE][root@fw-pwn.XXX.lan]/var/db/vnstat: date
    Thu Apr  2 12:38:34 PDT 2020
    

    Daily/hourly stats are correct:

         ...
         2020-03-29    15.43 GiB |    6.23 GiB |   21.66 GiB |    2.15 Mbit/s
         2020-03-30    18.18 GiB |    5.97 GiB |   24.14 GiB |    2.40 Mbit/s
         2020-03-31    20.44 GiB |    6.65 GiB |   27.09 GiB |    2.69 Mbit/s
         2020-04-01    22.44 GiB |    6.03 GiB |   28.47 GiB |    2.83 Mbit/s
         2020-04-02     5.25 GiB |    3.15 GiB |    8.40 GiB |    1.59 Mbit/s
         ------------------------+-------------+-------------+---------------
         estimated     10.02 GiB |    6.00 GiB |   16.02 GiB |
    

  • The same here.
    Even after after resetting the data, there is no data for april:

    Thu Apr  2 22:36:04 EET 2020
    
    Database updated: 2020-04-02 22:35:00
    
       WAN (mvneta2) since 2020-04-02
    
              rx:  13.71 MiB      tx:  10.33 MiB      total:  24.04 MiB
    
       monthly
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
           2020-03     13.71 MiB |   10.33 MiB |   24.04 MiB |       75 bit/s
         ------------------------+-------------+-------------+---------------
         estimated       --      |     --      |     --      |
    
       daily
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
             today     13.71 MiB |   10.33 MiB |   24.04 MiB |    2.48 kbit/s
         ------------------------+-------------+-------------+---------------
         estimated     14.57 MiB |   10.98 MiB |   25.55 MiB |
    

    I did the same test with a 2.5.0-DEVELOPMENT Pfsense and it's OK

    Database updated: 2020-04-02 22:40:00
    
       WAN (em0) since 2020-04-02
    
              rx:  3.24 MiB      tx:  408.88 KiB      total:  3.64 MiB
    
       monthly
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
           2020-04      3.24 MiB |  408.88 KiB |    3.64 MiB |      181 bit/s
         ------------------------+-------------+-------------+---------------
         estimated     49.44 MiB |    4.94 MiB |   54.38 MiB |
    
       daily
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
             today      3.24 MiB |  408.88 KiB |    3.64 MiB |      374 bit/s
         ------------------------+-------------+-------------+---------------
         estimated      3.43 MiB |     432 KiB |    3.86 MiB |
    

  • I bypassed this problem by changing the start day to 1 (I was on 10) with the webgui. Then I saved as default.
    I came back to 10 and save again and it seems to be good.

    Database updated: 2020-04-02 22:51:40
    
       WAN (mvneta2) since 2020-04-02
    
              rx:  3.66 MiB      tx:  5.00 MiB      total:  8.66 MiB
    
       monthly
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
           2020-03      3.59 MiB |    4.96 MiB |    8.56 MiB |       26 bit/s
           2020-04     65.06 KiB |   39.15 KiB |  104.21 KiB |        0 bit/s
         ------------------------+-------------+-------------+---------------
         estimated       --      |     --      |     --      |
    
       daily
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
             today      3.66 MiB |    5.00 MiB |    8.66 MiB |      882 bit/s
         ------------------------+-------------+-------------+---------------
         estimated      3.84 MiB |    5.25 MiB |    9.09 MiB |
    

  • Did that clear out the data? Want to try it too but not at the expense of losing my stats.


  • This bypass is not working because data are still added in march and not in april but maybe it's normal because the change is on the 10 for me.

    My data weren't erased but you can make a backup of your db

    Database updated: 2020-04-02 23:05:00
    
       WAN (mvneta2) since 2020-04-02
    
              rx:  872.47 MiB      tx:  195.35 MiB      total:  1.04 GiB
    
       monthly
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
           2020-03    872.41 MiB |  195.32 MiB |    1.04 GiB |    3.34 kbit/s
           2020-04     65.06 KiB |   39.15 KiB |  104.21 KiB |        0 bit/s
         ------------------------+-------------+-------------+---------------
         estimated       --      |     --      |     --      |
    
       daily
                         rx      |     tx      |    total    |   avg. rate
         ------------------------+-------------+-------------+---------------
             today    872.47 MiB |  195.35 MiB |    1.04 GiB |  107.79 kbit/s
         ------------------------+-------------+-------------+---------------
         estimated    907.12 MiB |  203.11 MiB |    1.08 GiB |
    
  • Rebel Alliance Developer Netgate

    When you change the start day, it counts things by that day of the "month". It may look weird but it's probably much easier for them to code it that way.


  • I guess for me an additional issue is that even though vnstat shows only up to March (yes I am on start day 22), my graphs show only up to Feb - probably due to time zone shift miscalculation.

    66995787-0c4b-453c-92d5-5219da7238e5-image.png

  • Rebel Alliance Developer Netgate

    IIRC that is from the DST shift (or maybe it was leap year). Sometimes it causes a month to show up double, other times it appears to be skipped.

    We can only use the data vnstat gives us. Since the output from vnstat has that quirk, you might want to submit a bug report directly to vnstat.


  • @jimp I believe there to be two quirks - vnstat outputting March and not April (though I do understand if that is due to accumulation of data due to non 1 start day), but the fact that vnstat output shows march and the traffic totals show Feb I believe is an issue in status_traffic_totals.php as it does not reflect March as vnstat does. I traced the code and saw it correctly fetches the march entry, but then it changes the date to Feb 29 18:00 or something, which is my PST shift.