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

    Vnstat2 with pfsense 2.1 snapshots?

    Scheduled Pinned Locked Moved pfSense Packages
    8 Posts 3 Posters 7.9k 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.
    • johnpozJ
      johnpoz LAYER 8 Global Moderator
      last edited by

      So it seems to be working, after you create the /var/db location, etc.

      But the frontend is broke

      ) is deprecated in /usr/local/www/vnstat2/vnstat.php on line 130 Deprecated: Function split() is deprecated in /usr/local/www/vnstat2/vnstat.php on line 130 Warning: Cannot modify header information - headers already sent by (output started at /usr/local/www/vnstat2/vnstat.php:130) in /usr/local/www/vnstat2/index.php on line 146

      Notice: Undefined index: totalrx in /usr/local/www/vnstat2/index.php on line 77 Notice: Undefined index: totalrxk in /usr/local/www/vnstat2/index.php on line 77 Notice: Undefined index: totaltx in /usr/local/www/vnstat2/index.php on line 78 Notice: Undefined index: totaltxk in /usr/local/www/vnstat2/index.php on line 78

      An intelligent man is sometimes forced to be drunk to spend time with his fools
      If you get confused: Listen to the Music Play
      Please don't Chat/PM me for help, unless mod related
      SG-4860 24.11 | Lab VMs 2.8, 24.11

      1 Reply Last reply Reply Quote 0
      • johnpozJ
        johnpoz LAYER 8 Global Moderator
        last edited by

        someone have clue to how to get vnstat working on the current 2.1 snaps

        I replaced split with explode – got rid of 130 error.. But not sure if right?

        Not reading data from what I can tell -- where exactly are the --dumpdb suppose to be stored?  Is that function how it works?

        Be nice if owner of this package would fix it up for us using 2.1 snaps, does it even work on 2.0 line?

        An intelligent man is sometimes forced to be drunk to spend time with his fools
        If you get confused: Listen to the Music Play
        Please don't Chat/PM me for help, unless mod related
        SG-4860 24.11 | Lab VMs 2.8, 24.11

        1 Reply Last reply Reply Quote 0
        • C
          Cino
          last edited by

          it does work with 2.0x releases, just not 2.1. 2.1 is using a different version of PHP. I think its 5.3, while 2.0x is using 5.2.. I'm not sure if vnstat-frontend (http://www.sqweek.com/sqweek/index.php?p=1) is ready for 5.3.

          1 Reply Last reply Reply Quote 0
          • M
            megamojo
            last edited by

            @johnpoz:

            So it seems to be working, after you create the /var/db location, etc.

            Can you elaborate on how to got it to work? I can't get mine to work at all. I replaced split with explode and got rid of that particular error, but it's still not getting any data. I can live without the php front-end, but I'd at least like the data I used to have under 2.0.

            1 Reply Last reply Reply Quote 0
            • johnpozJ
              johnpoz LAYER 8 Global Moderator
              last edited by

              you have to create the /var/db/vnstat directory

              An intelligent man is sometimes forced to be drunk to spend time with his fools
              If you get confused: Listen to the Music Play
              Please don't Chat/PM me for help, unless mod related
              SG-4860 24.11 | Lab VMs 2.8, 24.11

              1 Reply Last reply Reply Quote 0
              • C
                Cino
                last edited by

                Not going crazy with this write up as I don't really have the time.. This is a quick way to get you up and running with vnstat2 on 2.1 with 1.5.1 frontend.. I offer no support for this.

                1: Install vnstat2 package

                2: Since moving to PBI, vnstat is looking for its conf file at /usr/pbi/vnstat-i386/etc. Because of this this, the database isn't created correctly (/conf/vnstat) to match what is coded thru out the package. To fix this, enter the below in shell

                
                ln -s /usr/local/etc/vnstat.conf /usr/pbi/vnstat-i386/etc/vnstat.conf
                
                

                3: Re-install package GUI XML components only (This will now create the DB files for your interfaces using the correct paths based on /usr/local/etc/vnstat.conf

                4: Add this patch (search if your not sure how to add a patch. Add the system patches package; makes it easy)

                
                --- /usr/local/pkg/vnstat2.inc	2012-07-11 11:51:22.000000000 -0400
                +++ /root/custom/misc_files/vnstat2.inc	2012-07-11 12:12:29.000000000 -0400
                @@ -224,6 +224,8 @@
                 	}
                         $iface_title_array = implode($iface_title_array_items2);
                 	// php in php static items
                +        $locale = "\$locale";
                +        $language = "\$language";
                         $vnstat_bin2 = "\$vnstat_bin = '/usr/local/bin/vnstat';";
                         $data_dir2 = "\$data_dir = './dumps';";
                         $graph_format2 ="\$graph_format='svg';";
                @@ -261,6 +263,8 @@
                     //
                     // edit these to reflect your particular situation
                     //
                +$locale = 'en_US.UTF-8';
                +$language = 'en';
                
                     // list of network interfaces monitored by vnStat
                 $iface_list_array
                
                

                5: Goto Status:vnstat2, check the checkbox to enable the vnstat web frontend then click Save

                6: Delete everything within folder /usr/local/www/vnstat2 EXECPT for config.php

                7: Download this zip file and extract it to /usr/local/www/vnstat2
                https://dl.dropbox.com/u/11597356/pfSense/vnstat2.zip

                8: That should do it.. Goto Status:vnstat2 then the tab for the front end… Enjoy!!

                known issues::
                1: When you reboot, for some reason its not creating the /usr/local/www/vnstat2/config.php file correctly.. Easy fix tho, go to Status:vnstat2 and just click on the Save icon.. This will recreate /usr/local/www/vnstat2/config.php file...

                PS If you do a system firmware upgrade steps 4-8 may need to be completed again..but the database and the linked config will stay so it will collect data while your preforming the steps for the web frontend.

                1 Reply Last reply Reply Quote 0
                • johnpozJ
                  johnpoz LAYER 8 Global Moderator
                  last edited by

                  So I followed these instructions - grabbing the patches package was good suggestion ;)  Worked Great!

                  So attached is couple of screens showing it working - THANKS!

                  vnstat2working.jpg
                  vnstat2working.jpg_thumb
                  vnstat2hours.jpg
                  vnstat2hours.jpg_thumb
                  hours.jpg
                  hours.jpg_thumb

                  An intelligent man is sometimes forced to be drunk to spend time with his fools
                  If you get confused: Listen to the Music Play
                  Please don't Chat/PM me for help, unless mod related
                  SG-4860 24.11 | Lab VMs 2.8, 24.11

                  1 Reply Last reply Reply Quote 0
                  • C
                    Cino
                    last edited by

                    sweet! i'm going to copy my post and start a new topic shortly… wanted to make sure it worked  ;) before giving it out to the masses.

                    ps  Click on the pfSense GUI link... brings you back into the web interface

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.