Overall stats page

Discussion in 'Feature Requests' started by Ryanmt, May 8, 2008.

  1. Ryanmt

    Ryanmt New Member

    I would like a page that displays a list of sites on the server and their quotas/usages. Also a grand total of how much bandwidth has been used in that month :)
     
  2. minimalist

    minimalist Member

  3. Ryanmt

    Ryanmt New Member

    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.

    Code:
    ifconfig
    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:
    crontab -e
    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
     
  4. minimalist

    minimalist Member

  5. kassie

    kassie New Member

    What do i do here
     
  6. Ryanmt

    Ryanmt New Member

    edit config.php
     
  7. kassie

    kassie New Member

    Thanks for the help so far.

    I don't however get this thing to work.

    After forcing the command, i now have 2 files in the folder.
    config.php and vnstat_dump_eth0

    Is this right?
    When i now type http://www.server/server i get the following screen
    403 Error - Forbidden

    I have chmoded the folder to 777


    Isn't there supposed to be an index.php or index.htm??


    Sorry, fairly new to linux. Thanks for the help
     
  8. kassie

    kassie New Member

    Sorry....

    My bad,

    I had to download the files from the php frontend stuff. All is working now.

    I would like to seset the counters, where do i do that.
    It is registering a lot of data and it is not all correct. I had the server up for a year now but i think the overall traffic is correct but the day and week is wrong.

    I would like to start from scratch with traffic monitor from 1 Aug.
     
  9. falko

    falko Super Moderator ISPConfig Developer

    The traffic stats are stored in the table isp_traffic. To start from scratch, you can delete all records in that table.
     

Share This Page