View Full Version : Traffic stats doesn't work
ddelbia
8th January 2006, 22:08
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:
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
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?
admin
9th January 2006, 00:10
Have a look at this thread: http://www.howtoforge.com/forums/showthread.php?t=562
ddelbia
9th January 2006, 11:18
Ok, all works fine now with theese simple commands:
/etc/init.d/cron stop
pkill cron
crontab -e
exit and save (with vi :wq)
and
/etc/init.d/cron start
But it's strange...
What could be happened?
Maybe a missing reboot after installation? :-)
Sinisfun
16th January 2006, 00:57
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?
falko
16th January 2006, 10:32
You must run crontab -e as root!
Sinisfun
17th January 2006, 22:08
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 ?
falko
18th January 2006, 07:46
Do I need to create a folder to access these through the web as in www.mydomain.tld/stats ?
No, it's created automatically. :)
Sinisfun
19th January 2006, 02:48
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
falko
19th January 2006, 08:12
And you're sure you ran crontab -e as root?
Is there a way I can manually run the script to create this dir?
Run these commands:
/root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php
/root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php
Sinisfun
19th January 2006, 09:13
When I run the first one I get 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 providesFile Name to Write: /tmp/crontab.xaWBur/crontab is this correct to save it as?
till
19th January 2006, 11:21
When I run the first one I get 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.
The warning is nothing serious, it shall work anyway.
Thanks
On a side note when I run crontab -e again and save it it asks what to save it as and providesFile Name to Write: /tmp/crontab.xaWBur/crontab is this correct to save it as?
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.
falko
19th January 2006, 16:18
When I run the first one I get 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.
Have a look here: http://www.howtoforge.com/forums/showthread.php?t=1942
Sinisfun
19th January 2006, 22:11
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?
Sinisfun
19th January 2006, 22:14
Where does the crontab reside? I can save the output of nano to a dir, I guess I could over write the previous crontab.
falko
19th January 2006, 22:43
Please run crontab -e as root, not with sudo.
Sinisfun
19th January 2006, 22:45
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.
falko
19th January 2006, 23:16
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.
That's right.
Would changing my systems date and time temp allow the crons to run?
That should work.
Sinisfun
20th January 2006, 21:47
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,
till
20th January 2006, 23:36
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,
An the directory is not generated when you run these commands:
/root/ispconfig/php/php /root/ispconfig/scripts/shell/logs.php
/root/ispconfig/php/php /root/ispconfig/scripts/shell/webalizer.php
Sinisfun
21st January 2006, 00:53
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.
falko
21st January 2006, 08:19
You might have to debug the scripts by putting echo statements into them, like done here: http://www.howtoforge.com/forums/showthread.php?t=1942
Well, "debug" seems to be the wrong word since the scripts are working on most other installations (including mine and Till's), but something must be wrong on your system...
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.