Not quite what i was after.. but it will do the trick. Thanks
to install on ubuntu i did
Code:
apt-get install vnstat
then i ran ifconfig and got the name of the interface that is in use.
then start vnstat replace eth0 with your interface name
Code:
sudo vnstat -u -i eth0
once its running make the dir you want to put the phpstats into replace webXX with your domain directory.
Code:
cd /var/www/webXX/web/
mkdir server
.. you can also login to the ftp to make the folder but make sure it is chmodded to 777 or vnstat cant write to it.
edit crontab and add the following replace XX with your domain folder and eth0 with your network adapter name.
Code:
0,30 * * * * vnstat --dumpdb -i eth0 > /var/www/webXX/web/server/vnstat_dump_eth0
upload the PHP stats into the same folder and edit config to read.
Code:
$vnstat_bin = '';
$data_dir = '/var/www/webXX/web/server';
you can now access the stats via
www.yourdomain.com/server
stats are updated every at 0mins and 30mins of every hour so it may take a little while for the stats to update. you can force and update by running.
Code:
vnstat --dumpdb -i eth0 > /var/www/webXX/web/server/vnstat_dump_eth0
Recent comments
10 hours 46 min ago
13 hours 42 min ago
14 hours 55 min ago
16 hours 19 min ago
17 hours 57 min ago
19 hours 25 min ago
20 hours 39 min ago
1 day 12 hours ago
1 day 13 hours ago
1 day 17 hours ago