The pfSense Store

Author Topic: vnstat2 problems  (Read 3344 times)

0 Members and 1 Guest are viewing this topic.

Offline athurdent

  • Hero Member
  • *****
  • Posts: 650
  • Karma: +36/-7
  • N00b.
    • View Profile
vnstat2 problems
« on: November 12, 2014, 12:27:13 am »
I'm on the lastest beta, using a D200 notebook as test machine. It has only one Gigabit interface, so WAN1, WAN2 etc are tagged VLANs.
All Interfaces (the real one an the VLANs) show up as 1000baseT <full-duplex> in ifconfig though.

When I start a bigger download with over 100MBit, vnstats Cron job starts to send those mails until the transfer is over:

Code: [Select]
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin>
X-Cron-Env: <HOME=/var/log>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

Info: Traffic rate for "bge0" higher than set maximum 100 Mbit (60->825, r1587 t1588), syncing.
Info: Traffic rate for "bge0_vlan666" higher than set maximum 100 Mbit (60->825, r1559 t55), syncing.

Also the graphs do not work anymore:


Offline athurdent

  • Hero Member
  • *****
  • Posts: 650
  • Karma: +36/-7
  • N00b.
    • View Profile
Re: vnstat2 problems
« Reply #1 on: November 29, 2014, 02:35:04 am »
With the latest snapshots it seems completely broken. I'm using a RAM disk for /tmp and /var on that system if it matters.
Code: [Select]
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/etc:/bin:/sbin:/usr/bin:/usr/sbin>
X-Cron-Env: <HOME=/var/log>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>

Error: Unable to open database directory "/var/lib/vnstat".
Make sure it exists and is at least read enabled for current user.
Exiting...

Offline grandrivers

  • Sr. Member
  • ****
  • Posts: 566
  • Karma: +13/-2
    • View Profile
Re: vnstat2 problems
« Reply #2 on: November 29, 2014, 10:35:32 am »
this is also present

Notice: Undefined index: totalrx in /usr/local/www/vnstat2/index.php on line 81 Notice: Undefined index: totalrxk in /usr/local/www/vnstat2/index.php on line 81 Notice: Undefined index: totaltx in /usr/local/www/vnstat2/index.php on line 82 Notice: Undefined index: totaltxk in /usr/local/www/vnstat2/index.php on line 82 Notice: Illegal string offset 'rx' in /usr/local/www/vnstat2/index.php on line 89 Notice: Illegal string offset 'tx' in /usr/local/www/vnstat2/index.php on line 90 Notice: Illegal string offset 'rx' in /usr/local/www/vnstat2/index.php on line 94 Notice: Illegal string offset 'tx' in /usr/local/www/vnstat2/index.php on line 95 Notice: Illegal string offset 'rx' in /usr/local/www/vnstat2/index.php on line 99 Notice: Illegal string offset 'tx' in /usr/local/www/vnstat2/index.php on line 100


This page contains the following errors:

error on line 11 at column 8: Failed to parse QName 'Notice:'
Below is a rendering of the page up to the first error.
pfsense 2.4 super micro A1SRM-2558F
C2558 8gig ECC  60gig SSD
tripple Wan dual pppoe

Offline Mr. Jingles

  • Hero Member
  • *****
  • Posts: 1136
  • Karma: +92/-724
    • View Profile
    • The FreeBSD Foundation
Re: vnstat2 problems
« Reply #3 on: January 09, 2015, 10:09:08 am »
 ;D ;D ;D ;D ;D

This happened to me this afternoon (pic).

DO delete 1300 vnstat emails in a program as comfortable as ms outlook  :P

Offline Cino

  • Hero Member
  • *****
  • Posts: 1516
  • Karma: +61/-2
    • View Profile
Re: vnstat2 problems
« Reply #4 on: January 09, 2015, 03:33:54 pm »
not sure if this will help but the below patch corrects the "higher than set maximum 100 Mbit" error for me.. You could change the MaxBandwidth in the patch the max you have for your system..

Code: [Select]
--- /usr/local/pkg/vnstat2/vnstat2.inc 2014-06-12 21:21:08.000000000 -0400
+++ /root/custom/misc_files/vnstat2.inc 2014-06-22 10:39:15.000000000 -0400
@@ -91,6 +91,11 @@
 # vnstati
 ##
 
+# maximum bandwidth (Mbit) for all interfaces, 0 = disable feature
+# (unless interface specific limit is given)
+MaxBandwidth 0
+
+
 # image colors
 CBackground     "F0F0F0"
 CEdge           "AEAEAE"


Offline athurdent

  • Hero Member
  • *****
  • Posts: 650
  • Karma: +36/-7
  • N00b.
    • View Profile
Re: vnstat2 problems
« Reply #5 on: January 18, 2015, 09:25:44 am »
I think one of the problems with the installation might be this around line 149 in:

https://github.com/pfsense/pfsense-packages/blob/master/config/vnstat2/vnstat2.inc

Code: [Select]
// Check for pbi install and arch type then create symlinks
if (file_exists('/usr/pbi/vnstat-i386')) { exec("ln -s /usr/local/etc/vnstat.conf /usr/pbi/vnstat-i386/etc/vnstat.conf"); }
if (file_exists('/usr/pbi/vnstat-amd64')) { exec("ln -s /usr/local/etc/vnstat.conf /usr/pbi/vnstat-amd64/etc/vnstat.conf"); }

trying this manually results in:

Code: [Select]
ln -s /usr/local/etc/vnstat.conf /usr/pbi/vnstat-i386/etc/vnstat.conf
ln: /usr/pbi/vnstat-i386/etc/vnstat.conf: File exists

So vnstat2 keeps using the standard config and fails on us. Don't know about the packages installation logic but maybe just rm'ing the standard config first would do the trick?

Offline mir

  • Jr. Member
  • **
  • Posts: 93
  • Karma: +9/-0
    • View Profile
Re: vnstat2 problems
« Reply #6 on: January 18, 2015, 10:02:16 am »
Doing the following made it work here:
ln -sf /usr/local/etc/vnstat.conf /usr/pbi/vnstat-amd64/etc/vnstat.conf

Offline jimp

  • Administrator
  • Hero Member
  • *****
  • Posts: 21404
  • Karma: +1437/-26
    • View Profile
Re: vnstat2 problems
« Reply #7 on: February 03, 2015, 01:46:09 pm »
vnstat2 should be working fine now on 2.2, reinstall it and give it another try.
Need help fast? Commercial Support!

Co-Author of pfSense: The Definitive Guide. - Check the Doc Wiki for FAQs.

Do not PM for help!