Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    VNstat2 и PF 2.1 calendar problem

    Scheduled Pinned Locked Moved pfSense Packages
    38 Posts 2 Posters 6.4k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      DasTieRR
      last edited by

      @bryan.paradis:

      @DasTieRR:

      1. I cleared /cf/vnstat/ folder
      2. I executed command, they are created new DB with normal date (today date), then i copied old vnstat data (re1 re2 re3 files) and it shows me old date 16 jan. How can I can save my old vnstat data?

      This means that something has gone wrong with your old database. Did you change your server date sometime? Make a timezone change? Or something?

      1. With new  database do vnstat –dumpdb -i re1 and vnstat --dumpdb -i .re1
      2. With old database put back do vnstat --dumpdb -i re1 and vnstat --dumpdb -i .re1

      I do not remember, I changed timezone in old server - 2.0.x
      then we bought new PC and i installed clean PF 2.1, imported some config (from backup/restore) but vnstat database I did not copy. But I have one server, whith clean install and clean configurations, whithout backups and restore and it have same problem.
      Is there right command? They look same in first and second part.
      I done first command:
      vnstat –dumpdb -i re1 
      then
      vnstat --dumpdb -i .re1
      then copied old base re1 and .re1 with ovewright files
      then in cmd - vnstat --dumpdb -i re1  and vnstat --dumpdb -i .re1 and not see data from new base, only old data with 16 jan, and not 17 jan...

      1 Reply Last reply Reply Quote 0
      • B
        bryan.paradis
        last edited by

        Please paste the results and zip the old .re1 and re1 files and upload them here http://www.sendspace.com/ and give me link

        1 Reply Last reply Reply Quote 0
        • D
          DasTieRR
          last edited by

          @bryan.paradis:

          Please paste the results and zip the old .re1 and re1 files and upload them here http://www.sendspace.com/ and give me link

          http://www.sendspace.com/file/a95550

          1 Reply Last reply Reply Quote 0
          • B
            bryan.paradis
            last edited by

            Please post your /etc/crontab

            1 Reply Last reply Reply Quote 0
            • D
              DasTieRR
              last edited by

              @bryan.paradis:

              Please post your /etc/crontab

              SHELL=/bin/sh
              PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin
              HOME=/var/log
              #minute hour    mday    month  wday    who      command

              pfSense specific crontab entries

              Created: January 17, 2014, 4:27 pm

              0 * * * * root /usr/bin/nice -n20 newsyslog
              1,31 0-5 * * * root /usr/bin/nice -n20 adjkerntz -a
              1 3 1 * * root /usr/bin/nice -n20 /etc/rc.update_bogons.sh
              */60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 sshlockout
              1 1 * * * root /usr/bin/nice -n20 /etc/rc.dyndns.update
              */60 * * * * root /usr/bin/nice -n20 /usr/local/sbin/expiretable -v -t 3600 virusprot
              30 12 * * * root /usr/bin/nice -n20 /etc/rc.update_urltables
              0 0 * * * root /bin/rm /var/squid/cache/swap.state; /usr/pbi/squid-i386/sbin/squid -k rotate
              */15 * * * * root /usr/local/pkg/swapstate_check.php
              */1 * * * * root /usr/local/pkg/vnstat2.sh
              */1 * * * * root /root/tolog.sh
              */10 * * * * root /usr/bin/perl /usr/pbi/lightsquid-i386/www/lightsquid/lightparser.pl today
              15 0 * * * root /usr/bin/perl /usr/pbi/lightsquid-i386/www/lightsquid/lightparser.pl yesterday
              0 0 * * * root /usr/bin/nice -n20 /usr/pbi/squidguard-i386/etc/rc.d/squidGuard_logrotate

              If possible do not add items to this file manually.

              If you do so, this file must be terminated with a blank line (e.g. new line)

              1 Reply Last reply Reply Quote 0
              • B
                bryan.paradis
                last edited by

                If you do vnstat -u are the dates correct?

                1 Reply Last reply Reply Quote 0
                • D
                  DasTieRR
                  last edited by

                  @bryan.paradis:

                  If you do vnstat -u are the dates correct?

                  In cmd? in cmd result of vnstat -u empty

                  1 Reply Last reply Reply Quote 0
                  • B
                    bryan.paradis
                    last edited by

                    @DasTieRR:

                    @bryan.paradis:

                    If you do vnstat -u are the dates correct?

                    In cmd? in cmd result of vnstat -u empty

                    Look at php front end dates now. does it say 17th

                    1 Reply Last reply Reply Quote 0
                    • D
                      DasTieRR
                      last edited by

                      @bryan.paradis:

                      @DasTieRR:

                      @bryan.paradis:

                      If you do vnstat -u are the dates correct?

                      In cmd? in cmd result of vnstat -u empty

                      Look at php front end dates now. does it say 17th

                      Yes, but in Moscow 18 jan…

                      1 Reply Last reply Reply Quote 0
                      • B
                        bryan.paradis
                        last edited by

                        @DasTieRR:

                        @bryan.paradis:

                        @DasTieRR:

                        @bryan.paradis:

                        If you do vnstat -u are the dates correct?

                        In cmd? in cmd result of vnstat -u empty

                        Look at php front end dates now. does it say 17th

                        Yes, but in Moscow 18 jan…

                        so does it say 18th now?

                        1 Reply Last reply Reply Quote 0
                        • D
                          DasTieRR
                          last edited by

                          @bryan.paradis:

                          @DasTieRR:

                          @bryan.paradis:

                          @DasTieRR:

                          @bryan.paradis:

                          If you do vnstat -u are the dates correct?

                          In cmd? in cmd result of vnstat -u empty

                          Look at php front end dates now. does it say 17th

                          Yes, but in Moscow 18 jan…

                          so does it say 18th now?

                          No 17…
                          Today, 18 jan I (have) test:
                          I del files re1 re2 re3 .re1 .re2 .re3 and cmd vnstat -u -i re1 and others
                          I got at the phpfrontend clean base with zero data and date 17 jan (but today 18)

                          4.jpg
                          4.jpg_thumb

                          1 Reply Last reply Reply Quote 0
                          • D
                            DasTieRR
                            last edited by

                            add:

                            Then I copied old base (end data 16 jan) and refresh phpfrontend - programm add 17 jan, not 18…

                            In russian thread is another person with same problem - in the base he has two 2013 year. (And I have two 2013 year too)

                            1 Reply Last reply Reply Quote 0
                            • B
                              bryan.paradis
                              last edited by

                              @DasTieRR:

                              1. I cleared /cf/vnstat/ folder
                              2. I executed command, they are created new DB with normal date (today date), then i copied old vnstat data (re1 re2 re3 files) and it shows me old date 16 jan (again).
                              How can I can save my old vnstat data in new DataBase re1 re 2 re3?

                              So when you create new database files for re1 re2 and re3 is the date right or wrong? You seem to have contradicted yourself. Forget about copying back the old files. We need to know if the new database files have the correct date or not.

                              1 Reply Last reply Reply Quote 0
                              • D
                                DasTieRR
                                last edited by

                                @bryan.paradis:

                                @DasTieRR:

                                1. I cleared /cf/vnstat/ folder
                                2. I executed command, they are created new DB with normal date (today date), then i copied old vnstat data (re1 re2 re3 files) and it shows me old date 16 jan (again).
                                How can I can save my old vnstat data in new DataBase re1 re 2 re3?

                                So when you create new database files for re1 re2 and re3 is the date right or wrong? You seem to have contradicted yourself. Forget about copying back the old files. We need to know if the new database files have the correct date or not.

                                Today - 18jan date wrong - 17jan.
                                But when i created clean DB yesterday (17 jan) it was normal 17 jan!
                                18 jan I decided to forget about problem and begin life with new base and was shocked when my new base got wrong date!
                                In 10 minutes I do new test with scrennshots.

                                1 Reply Last reply Reply Quote 0
                                • D
                                  DasTieRR
                                  last edited by

                                  1 screenshot - current base (old data)
                                  2 - kill all DB files
                                  3 cmd command to create DB - wrong data :(

                                  After that
                                  1. I copied old base with ovewright - in base old data - to 16 jan
                                  2. in cmd exc command vnstat -u -i re1 and others
                                  and in phpfrontend
                                  I saw plus one day - 16 jan and 17 jan

                                  P.S. today 18 jan

                                  ![current base.jpg](/public/imported_attachments/1/current base.jpg)
                                  ![current base.jpg_thumb](/public/imported_attachments/1/current base.jpg_thumb)
                                  ![killed all data.jpg](/public/imported_attachments/1/killed all data.jpg)
                                  ![killed all data.jpg_thumb](/public/imported_attachments/1/killed all data.jpg_thumb)
                                  ![new base.jpg](/public/imported_attachments/1/new base.jpg)
                                  ![new base.jpg_thumb](/public/imported_attachments/1/new base.jpg_thumb)

                                  1 Reply Last reply Reply Quote 0
                                  • B
                                    bryan.paradis
                                    last edited by

                                    Ok. Very strange. with this clean database can you please post the output of vnstat -i re1 –dumpdb

                                    1 Reply Last reply Reply Quote 0
                                    • B
                                      bryan.paradis
                                      last edited by

                                      My guess is you downloaded vnstat_php_frontend current from github and that the timezone is set to something different in config.php

                                      1. Please delete:

                                      /usr/local/www/vnstat_php_frontend-1.4.1
                                      /usr/local/www/vnstat2/vnstat_php_frontend-1.4.1

                                      2. Please copy and paste all text inside into post:

                                      /usr/local/www/vnstat2/config.php

                                      3. Then delete:

                                      /usr/local/www/vnstat2

                                      4. Download my vnstat_php_frontend-1.5.1-updated

                                      http://www.sendspace.com/file/0py5vt

                                      5. Extract the vnstat2 folder and place it at:

                                      /usr/local/www/vnstat2

                                      6. It will not work yet until we setup config.php so it will still be broken but I need information first

                                      1 Reply Last reply Reply Quote 0
                                      • D
                                        DasTieRR
                                        last edited by

                                        @bryan.paradis:

                                        Ok. Very strange. with this clean database can you please post the output of vnstat -i re1 –dumpdb

                                        1.jpg
                                        1.jpg_thumb
                                        2.jpg
                                        2.jpg_thumb

                                        1 Reply Last reply Reply Quote 0
                                        • D
                                          DasTieRR
                                          last edited by

                                          @bryan.paradis:

                                          My guess is you downloaded vnstat_php_frontend current from github and that the timezone is set to something different in config.php

                                          1. Please delete:

                                          /usr/local/www/vnstat_php_frontend-1.4.1
                                          /usr/local/www/vnstat2/vnstat_php_frontend-1.4.1

                                          2. Please copy and paste all text inside into post:

                                          /usr/local/www/vnstat2/config.php

                                          3. Then delete:

                                          /usr/local/www/vnstat2

                                          4. Download my vnstat_php_frontend-1.5.1-updated

                                          http://www.sendspace.com/file/0py5vt

                                          5. Extract the vnstat2 folder and place it at:

                                          /usr/local/www/vnstat2

                                          6. It will not work yet until we setup config.php so it will still be broken but I need information first

                                          all done

                                              //
                                              // vnStat PHP frontend 1.4.1 (c)2006-2008 Bjorge Dijkstra (bjd@jooz.net)
                                              //
                                              // This program is free software; you can redistribute it and/or modify
                                              // it under the terms of the GNU General Public License as published by
                                              // the Free Software Foundation; either version 2 of the License, or
                                              // (at your option) any later version.
                                              //
                                              // This program is distributed in the hope that it will be useful,
                                              // but WITHOUT ANY WARRANTY; without even the implied warranty of
                                              // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
                                              // GNU General Public License for more details.
                                              //
                                              // You should have received a copy of the GNU General Public License
                                              // along with this program; if not, write to the Free Software
                                              // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
                                              //
                                              //
                                              // see file COPYING or at http://www.gnu.org/licenses/gpl.html 
                                              // for more information.
                                              //
                                              error_reporting(E_ALL | E_NOTICE);
                                          
                                              //
                                              // configuration parameters
                                              //
                                              // edit these to reflect your particular situation
                                              //
                                          $locale = 'en_US.UTF-8';
                                          $language = 'en';
                                          
                                              // list of network interfaces monitored by vnStat
                                          $iface_list = array('re1', 're2', 're3');
                                          
                                              //
                                              // optional names for interfaces
                                              // if there's no name set for an interface then the interface identifier
                                              // will be displayed instead
                                          $iface_title['re1'] = 'MTS';
                                          $iface_title['re2'] = 'WAN';
                                          $iface_title['re3'] = 'LAN';
                                          
                                              //
                                              // There are two possible sources for vnstat data. If the 
                                              // variable is set then vnstat is called directly from the PHP script
                                              // to get the interface data. 
                                              //
                                              // The other option is to periodically dump the vnstat interface data to
                                              // a file (e.g. by a cronjob). In that case the  variable
                                              // must be cleared and set  to the location where the dumps
                                              // are stored. Dumps must be named 'vnstat_dump_'.
                                              //
                                              // You can generate vnstat dumps with the command:
                                              //   vnstat --dumpdb -i  > /path/to/data_dir/vnstat_dump_
                                              // 
                                          $vnstat_bin = '/usr/local/bin/vnstat';
                                          $data_dir = './dumps';
                                          
                                              // graphics format to use: svg or png
                                          $graph_format='svg';
                                          
                                              // Font to use for PNG graphs
                                              define('GRAPH_FONT',dirname(__FILE__).'/VeraBd.ttf');
                                          
                                              // Font to use for SVG graphs
                                              define('SVG_FONT', 'Verdana');
                                          
                                              // color schemes
                                              // colors are defined as R,G,B,ALPHA quads where R, G and B range from 0-255
                                              // and ALPHA from 0-127 where 0 is opaque and 127 completely transparent.
                                              //
                                              define('DEFAULT_COLORSCHEME', 'pfSense');
                                          
                                              $colorscheme['light'] = array(
                                                   'stylesheet'         => 'vnstat.css',
                                                   'image_background'   => array( 255, 255, 255,   0 ),
                                          	 'graph_background'   => array( 220, 220, 230,   0 ),
                                          	 'graph_background_2' => array( 205, 205, 220,   0 ),
                                          	 'grid_stipple_1'     => array( 140, 140, 140,   0 ),
                                                   'grid_stipple_2'     => array( 200, 200, 200,   0 ),
                                          	 'border'             => array(   0,   0,   0,   0 ),
                                          	 'text'               => array(   0,   0,   0,   0 ),
                                          	 'rx'                 => array( 190, 190,  20,  50 ),
                                          	 'rx_border'	      => array(  40,  80,  40,  90 ),
                                          	 'tx'	              => array( 130, 160, 100,  50 ),
                                          	 'tx_border'          => array(  80,  40,  40,  90 )
                                               );
                                          
                                              // A red colorscheme based on a contribution by Enrico TrГ¶ger
                                              $colorscheme['red'] = array(
                                                   'stylesheet'         => 'vnstat_red.css',
                                                   'image_background'   => array( 225, 225, 225,   0 ),
                                          	 'graph_background'   => array( 220, 220, 230,   0 ),
                                          	 'graph_background_2' => array( 205, 205, 220,   0 ),
                                          	 'grid_stipple_1'     => array( 140, 140, 140,   0 ),
                                                   'grid_stipple_2'     => array( 200, 200, 200,   0 ),
                                          	 'border'             => array(   0,   0,   0,   0 ),
                                          	 'text'               => array(   0,   0,   0,   0 ),
                                          	 'rx'                 => array( 190,  20,  20,  50 ),
                                          	 'rx_border'	      => array(  80,  40,  40,  90 ),
                                          	 'tx'	              => array( 130, 130, 130,  50 ),
                                          	 'tx_border'          => array(  60,  60,  60,  90 )
                                               );
                                          
                                              // A red colorscheme based on a contribution by Perry Mason
                                              $colorscheme['pfSense'] = array(
                                                   'stylesheet'         => 'vnstat_pfSense.css',
                                                   'image_background'   => array( 240, 240, 240,   0 ),
                                          	 'graph_background'   => array( 255, 255, 255,   0 ),
                                          	 'graph_background_2' => array( 255, 255, 255,   0 ),
                                          	 'grid_stipple_1'     => array( 144, 0, 0,   0 ),
                                                   'grid_stipple_2'     => array( 144, 0, 0,   0 ),
                                          	 'border'             => array(   0,   0,   0,   0 ),
                                          	 'text'               => array(   0,   0,   0,   0 ),
                                          	 'rx'                 => array( 190,  20,  20,  50 ),
                                          	 'rx_border'	      => array(  80,  40,  40,  90 ),
                                          	 'tx'	              => array( 130, 130, 130,  50 ),
                                          	 'tx_border'          => array(  60,  60,  60,  90 )
                                               );
                                          ?>
                                          
                                          1 Reply Last reply Reply Quote 0
                                          • B
                                            bryan.paradis
                                            last edited by

                                            $iface_list = array('re1', 're2', 're3');
                                            
                                            $iface_title['re1'] = 'MTS';
                                            $iface_title['re2'] = 'WAN';
                                            $iface_title['re3'] = 'LAN';
                                            

                                            1. put those into the new config file you extracted /usr/local/www/vnstat2/config.php by replacing the defaults
                                            2. vnstat -u
                                            3. vnstat -d -i re1
                                            4. paste the output of 3. into a post
                                            5. check php front end date
                                            6. if that fails edit /usr/local/www/vnstat2/config.php and put date_default_timezone_set('Europe/Moscow'); like example below

                                            
                                            $locale = 'en_US.UTF-8';
                                            $language = 'en';
                                            date_default_timezone_set('Europe/Moscow');
                                            
                                            
                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.