HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   Traffic Statistics Not Working (http://www.howtoforge.com/forums/showthread.php?t=10728)

tsj5j 20th February 2007 05:38

Traffic Statistics Not Working
 
Hello,

I am using a hacked version of ISPConfig to make it work with lighttpd.
Currently, everything works fine - except traffic statistics.

It seems that traffic statistics for websites aren't monitored.
I'm sure the sites are being used, and I even made some test downloads.
However, the statistics remained at 0.

I then proceed to check my crontab, and found :
Quote:

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
Seems fine to me. I then tried to run every line in the crontab manually.
The web traffic statistics remained at 0, but the FTP statistics updated.

I went to check the access log files - they were present and recording accurately.
I went to check the webalizer output files (HTML) - those recorded the KB of bandwidth accurately as well.

The only thing is I can't get ISPConfig to get its statistics updated.

QUESTIONS
- What am I doing wrong?
- Which Shell PHP file controls the updating of traffic usage?

till 20th February 2007 07:58

Quote:

- What am I doing wrong?
I'am not sure if traffic stats for lighttpd are implemented at all. It will only work if your httpd server writes the exact same files then apache.

Quote:

- Which Shell PHP file controls the updating of traffic usage?
/root/ispconfig/scripts/shell/logs.php
/root/ispconfig/scripts/shell/webalizer.php

tsj5j 20th February 2007 08:22

Quote:

218.186.10.12 unknownbrowse.com - [20/Feb/2007:01:10:31 -0600] "GET /index.php?q=aHR0cDovL3d3dy55b3V0dWJlLmNvbS9jc3MvYm FzZV95dHMxMTcwMTAwMjU3LmNzcw%3D%3D HTTP/1.1" 200 20002 "http://unknownbrowse.com/index.php?q=aHR0cDovL3d3dy55b3V0dWJlLmNvbQ%3D%3D&h l=3ed" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.9) Gecko/20061206 Firefox/1.5.0.9"
A sample line from the access log ouput.

I don't see how ISPConfig is unable to read it since Webalizer reads it fine.

till 20th February 2007 08:32

Thats not compatible with ISPConfig. If you want to get splitted logs, the must have the following format and they must be logged by cronolog.

Apache directive:

Code:

LogFormat "%v||||%b||||%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined_ispconfig
CustomLog "|/root/ispconfig/cronolog --symlink=/var/log/httpd/ispconfig_access_log /var/log/httpd/ispconfig_access_log_%Y_%m_%d" combined_ispconfig


tsj5j 20th February 2007 08:55

Just curious, why can webalizer parse it fine?

Can you also show me a sample output line? Thanks.

till 20th February 2007 09:15

Webalizer did not parse this file directly, it is parsed by the ISPConfig logs script to account the traffic and split the file for the websites.

tsj5j 20th February 2007 09:17

What I mean is, I'm curious how webalizer.php parses the logs sucessfully and output correct HTML files in the stats folder in all my sites probably.

Yet ISPConfig doesn't seem to get its traffic stats updated.

till 20th February 2007 10:26

Quote:

What I mean is, I'm curious how webalizer.php parses the logs sucessfully and output correct HTML files in the stats folder in all my sites probably.
webalizer.php does not paerse these logs as I posted above. The logs where parsed and splitted by logs.php and stored in the log directory of the websites. When this is finished, webalizer.php runs the webalizer program for every splitted logfile to generate the statistics.

Have a look at the code if you want to know how the logfiles where processed in detail.

tsj5j 20th February 2007 10:31

Strange. My site is being processed differently.

LightTPD stores a single log in the where the log file is set, and a log file for each and every site.
Webalizer reads the logs generated in each site and generates the HTML output.

No splitting involved 0.0

till 20th February 2007 10:34

Quote:

Originally Posted by tsj5j
Strange. My site is being processed differently.

LightTPD stores a single log in the where the log file is set, and a log file for each and every site.
Webalizer reads the logs generated in each site and generates the HTML output.

No splitting involved 0.0

Either you write a logfile as I explained above or you are not able to use the ISPConfig traffic accounting and webalizer stats. I've written these scripts so I know what I'am talking about.


All times are GMT +2. The time now is 02:32.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.