Traffic stats doesn't work

Discussion in 'Installation/Configuration' started by ddelbia, Jan 8, 2006.

  1. ddelbia

    ddelbia Member

    Hi all,

    I've installed ISPConfig 3 days ago and traffic statistic doesn't work.

    Apache log are splitted in daily files in /var/log/httpd but in the site's logdir, I see only error log and no directory "stats" under "web" (webalizer?)
    Xferlog doesn't rotate.

    crontab -e shows:

    Code:
    30 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php &> /dev/null
    59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/ftp_logs.php &> /dev/null
    59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/mail_logs.php &> /dev/null
    59 23 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/cleanup.php &> /dev/null
    0 4 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php &> /dev/null
    0,30 * * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/check_services.php &> /dev/null
    15 3,15 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/quota_msg.php &> /dev/null
    40 00 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/traffic.php &> /dev/null
    05 02 * * * /root/ispconfig/php/php /root/ispconfig/scripts/shell/backup.php &> /dev/null
    
    And this is the web site's statistic page

    Code:
    Traffic overview (in MB):
    Month Web FTP Mail Overall 
    
    --------------------------------------------------------------------------------
    Overall: 0.00 0.00 0.00 0.00 
    
    --------------------------------------------------------------------------------
    Traffic in the last 4 years (in MB):
    Year Web FTP Mail Overall 
    2006: 0.00 0.00 0.00 0.00 
    2005: 0.00 0.00 0.00 0.00 
    2004: 0.00 0.00 0.00 0.00 
    2003: 0.00 0.00 0.00 0.00 
    
    Any idea?
     
  2. admin

    admin Administrator Staff Member Moderator

  3. ddelbia

    ddelbia Member

    Ok, all works fine now with theese simple commands:

    Code:
    /etc/init.d/cron stop
    pkill cron
    crontab -e
    
    exit and save (with vi :wq)
    and

    Code:
    /etc/init.d/cron start
    
    But it's strange...

    What could be happened?
    Maybe a missing reboot after installation? :)
     
  4. Sinisfun

    Sinisfun New Member

    I have the same issue however when I edit and save my crontab it is empty... is this correct? I have followed the link you provided a few times over however I still have no stats? Any ideas?
     
  5. falko

    falko Super Moderator Howtoforge Staff

    You must run
    Code:
    crontab -e
    as root!
     
  6. Sinisfun

    Sinisfun New Member

    So yeah... I failed to run it as root... did as it said and I have stats now when I view them through my login to ISPconfig... Do I need to create a folder to access these through the web as in www.mydomain.tld/stats ?
     
  7. falko

    falko Super Moderator Howtoforge Staff

    No, it's created automatically. :)
     
  8. Sinisfun

    Sinisfun New Member

    I dont want to be a pain really... :)

    However it has been more than 36hrs since stats through the login screen have appeared and there still is no access through www.domain.tld/stats just a 404.

    Is there a way I can manually run the script to create this dir?

    Thanks again
     
  9. falko

    falko Super Moderator Howtoforge Staff

    And you're sure you ran
    Code:
    crontab -e
    as root?

    Run these commands:

    Code:
    /root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php
    /root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php
     
  10. Sinisfun

    Sinisfun New Member

    When I run the first one I get
    Code:
    Warning: readlink(): Invalid argument in /root/ispconfig/scripts/shell/logs.php on line 125
    
    however the second one seems to run fine. And as for your first question I am sure I ran crontab -e as root.. when I did that it compiled stats that night and had not any prior nights.

    Thanks

    On a side note when I run crontab -e again and save it it asks what to save it as and provides
    Code:
    File Name to Write: /tmp/crontab.xaWBur/crontab
    is this correct to save it as?
     
    Last edited: Jan 19, 2006
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    The warning is nothing serious, it shall work anyway.

    Thanks

    Never seen that. In which editor has the crontab been opened? If it is vi, you can save it simply by typing ":x" and hit the return key.
     
  12. falko

    falko Super Moderator Howtoforge Staff

    Have a look here: http://www.howtoforge.com/forums/showthread.php?t=1942
     
  13. Sinisfun

    Sinisfun New Member

    In reply to which editor it opens in it opened with Nano. I try to sudo vi crontab and it tells me that it is creating a new file. Will I have to call the crontab from its home dir using vi?
     
  14. Sinisfun

    Sinisfun New Member

    Where does the crontab reside? I can save the output of nano to a dir, I guess I could over write the previous crontab.
     
  15. falko

    falko Super Moderator Howtoforge Staff

    Please run
    Code:
    crontab -e
    as root, not with sudo.
     
  16. Sinisfun

    Sinisfun New Member

    I have since learned that sudo is not the same as root and I have enabled the root user in ubuntu. I followed the commands kill cron - edit crontab (Still with nano :( )- start cron then I ran those commands you gave me to manually run the cron... I still dont see stats but I am asuming that when all of the crons run at 04:00 (correct me if I am wrong) I should see the stats. Would changing my systems date and time temp allow the crons to run?

    Again thanks for your help and being so patient.
     
  17. falko

    falko Super Moderator Howtoforge Staff

    That's right.

    That should work.
     
  18. Sinisfun

    Sinisfun New Member

    So are there any logs that I can check to see why the stats are not available through www.domain.tld/stats I still get a 404 error and when I login using an ftp client I still do not see a stats folder. I am sure that I was root when I followed those cmds last time. Would it be worth while reinstalling webalizer or are there steps we can take before that?

    Thanks again for your help,
     
  19. till

    till Super Moderator Staff Member ISPConfig Developer

    An the directory is not generated when you run these commands:

    Code:
    /root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php
    /root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php
     
  20. Sinisfun

    Sinisfun New Member

    When I login as root through putty and paste the first cmd I still get that error I previously stated, then I paste in the second cmd and it seems to run without any problems. However there is still no stats directory.
     

Share This Page