Koozali.org: home of the SME Server

Vnstat (Internet traffic monitoring & report - GB by month - ISP)

Offline ourspolaire

  • *
  • 40
  • +0/-0
Hi,

http://wiki.contribs.org/Vnstat

I have an error here:

******************************************************
# $iface_list = array('eth0', 'eth1');
-bash: syntax error near unexpected token `('
******************************************************

How to fit that?





Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #1 on: November 29, 2009, 06:26:17 PM »
ourspolaire: you have to edit config.php that is a php file..

I've edited wiki's page because it was not clear

HTH

Offline ourspolaire

  • *
  • 40
  • +0/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #2 on: November 29, 2009, 11:32:09 PM »
Stefano,

I edited the config.php file.

It works but not at 100%:

Every minutes I receive an email of Cron Daemon saying:

Error: Unable create database backup "/var/lib/vnstat/.eth0".



How can I fix that?

Could I remove the applications (uninstall) related to vnstat and then redo the install again?  How to do that?

« Last Edit: November 30, 2009, 12:28:13 AM by ourspolaire »

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #3 on: November 30, 2009, 12:08:20 AM »
edit /etc/cron.d/vnstat and change nobody to root

then restart cron service with
Code: [Select]
service crond restart

it should work

Ciao

Offline ourspolaire

  • *
  • 40
  • +0/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #4 on: November 30, 2009, 02:06:43 AM »
Ok, emails from Cron Daemon has stopped.

*********************************************************
Next bug:

eth1 seems not operational.

eth0 seems record internet activity & the data exchange between my workstation and my SME server, all together.


# vnstat

                      rx      /      tx      /     total    /   estimated
 eth1: Not enough data available yet.
 eth0:
         today      1.69 GiB  /  490.02 MiB  /    2.17 GiB  /    2.62 GiB
« Last Edit: November 30, 2009, 02:23:02 AM by ourspolaire »

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #5 on: November 30, 2009, 08:37:56 AM »
please post the output of
Code: [Select]
ifconfig

Offline ourspolaire

  • *
  • 40
  • +0/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #6 on: November 30, 2009, 02:57:15 PM »
# ifconfig
bond0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          inet addr:1.1.1.1  Bcast:1.255.255.255  Mask:255.0.0.0
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

eth0      Link encap:Ethernet  HWaddr 00:0D:88:36:A7:45
          inet addr:192.168.77.1  Bcast:192.168.77.255  Mask:255.255.255.0
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:12302728 errors:14 dropped:0 overruns:0 frame:0
          TX packets:14296277 errors:0 dropped:0 overruns:0 carrier:0
          collisions:94585 txqueuelen:1000
          RX bytes:2228787906 (2.0 GiB)  TX bytes:852964101 (813.4 MiB)
          Interrupt:50 Base address:0x2000

eth1      Link encap:Ethernet  HWaddr 00:E0:29:40:B0:8D
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13686764 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11046207 errors:0 dropped:0 overruns:0 carrier:0
          collisions:170005 txqueuelen:1000
          RX bytes:913108543 (870.8 MiB)  TX bytes:571477392 (545.0 MiB)
          Interrupt:217 Base address:0x6000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:19008 errors:0 dropped:0 overruns:0 frame:0
          TX packets:19008 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:2159765 (2.0 MiB)  TX bytes:2159765 (2.0 MiB)

ppp0      Link encap:Point-to-Point Protocol
          inet addr:74.13.144.232  P-t-P:64.230.197.42  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:13677883 errors:0 dropped:0 overruns:0 frame:0
          TX packets:11037326 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:611631758 (583.2 MiB)  TX bytes:328101480 (312.9 MiB)

Offline Stefano

  • *
  • 10,836
  • +2/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #7 on: November 30, 2009, 11:19:57 PM »
well, I think that you should edit your config.php and use eth0 and ppp0 interfaces

Offline ourspolaire

  • *
  • 40
  • +0/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #8 on: December 01, 2009, 04:17:02 AM »
Ok I will test that.

Just in case:

How to uninstall everything about Vnstat?

Offline ourspolaire

  • *
  • 40
  • +0/-0
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #9 on: December 02, 2009, 12:42:51 AM »
To test, I did:

# vnstat -u -i eth0
# vnstat -u -i eth1
# vnstat -u -i ppp0
# vnstat -u -i bond0


Result:

# vnstat

                      rx      /      tx      /     total    /   estimated
 bond0: Not enough data available yet.
 eth1: Not enough data available yet.
 eth0:
         today     48.10 MiB  /   67.63 MiB  /  115.74 MiB  /     147 MiB

 ppp0: Not enough data available yet.



Strange:  ppp0 is not displayed.

Offline gippsweb

  • ****
  • 232
  • +0/-0
    • Wots I.T.?
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #10 on: December 02, 2009, 06:33:30 AM »
I can confirm ppp0 is not showing, I've just set it up here and am seeing the same results..

Offline Mntsnow

  • **
  • 59
  • +0/-0
    • http://www.mntsnow.com
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #11 on: February 08, 2010, 06:26:25 PM »
Could we get this info added into the vnstat wiki page?

edit the  "/etc/cron.d/vnstat" config file and change "nobody" to "root"

then restart the cron service with

"service crond restart"


as that is what I also needed to do to get it to work.
SME-8 64bit
PowerEdge 1950 III
(2) Quad Core Xeon x5460 @ 3.16GHz
24Gb Memory
PERC 5i raid controller
4 x 500Gb SAS 7.2K Drives in Raid 5
Dual 1Gb Nics

Offline Mntsnow

  • **
  • 59
  • +0/-0
    • http://www.mntsnow.com
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #12 on: February 09, 2010, 04:50:50 PM »
How can I go about figuring out why my eth1 interface numbers are not updating?  Phpsysinfo shows the correct usage.
« Last Edit: February 09, 2010, 08:20:20 PM by Mntsnow »
SME-8 64bit
PowerEdge 1950 III
(2) Quad Core Xeon x5460 @ 3.16GHz
24Gb Memory
PERC 5i raid controller
4 x 500Gb SAS 7.2K Drives in Raid 5
Dual 1Gb Nics

Offline Mntsnow

  • **
  • 59
  • +0/-0
    • http://www.mntsnow.com
Re: Vnstat (Internet traffic monitoring & report - GB by month - ISP)
« Reply #13 on: February 10, 2010, 05:11:59 PM »
Update....If I manually run the following command it will update but if I do not manually run this command the application only updates the eth0 interface info??

# vnstat -u

Where do I find the script that is doing the updating to see if something is wrong the and only calling for the eth0 instead of both the eth0 & eth1 to both update?

Thanks in advance for any help.


Update at 9:52am    I am thinking the problem is in the file  -------/etc/sysconfig/vnstat--------


VNSTAT_OPTIONS="-i eth0"     (this was the original and it's only calling for the eth0 interface to be updated)   Do I just clear that line?

Update at 1:43pm   I seem to have it working and what I did was in the file listed above I changed the line to read
Quote
VNSTAT_OPTIONS="-u"
and now both interfaces seem to be consistantly updating for the past 4 hours.
« Last Edit: February 10, 2010, 09:47:50 PM by Mntsnow »
SME-8 64bit
PowerEdge 1950 III
(2) Quad Core Xeon x5460 @ 3.16GHz
24Gb Memory
PERC 5i raid controller
4 x 500Gb SAS 7.2K Drives in Raid 5
Dual 1Gb Nics