Author |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Thu 25 Feb '10 15:02 Post subject: ApacheStats doesn't count values for graphs |
|
|
I setup ApacheStats (http://www.apachelounge.com/download/ApacheStats.zip) with mrtg-2.16.3 and ActivePerl-5.10.1.1007-MSWin32-x64-291969. I follow installation and configuration description and add ApacheStats-Memory-Add-on.zip. I setup it on two different machines : one with WinXP SP3 with Apache 2.2.11 and second is Win2k3 x64 with Apache 2.2.14. I'm facing same issue on both - only httpd-ram.html (ApacheStats-Memory-Add-on.zip) is working fine. All others available graphs are blank (BusyWorkers, Accesses, Traffic). I've checked .log files for those graphs and f.x. apache-busyworkers.log contains :
Code: |
1267102554 -1 -1
1267102554 0 0 0 0
1267102255 0 0 0 0
1267102200 0 0 0 0
1267101900 0 0 0 0
1267101600 0 0 0 0
1267101300 0 0 0 0
1267101000 0 0 0 0
1267100700 0 0 0 0
1267100400 0 0 0 0
1267100100 0 0 0 0
1267099800 0 0 0 0
1267099500 0 0 0 0
1267099200 0 0 0 0
1267098900 0 0 0 0
1267098600 0 0 0 0
1267098300 0 0 0 0
1267098000 0 0 0 0
1267097700 0 0 0 0
1267097400 0 0 0 0
1267097100 0 0 0 0
1267096800 0 0 0 0
1267096500 0 0 0 0
1267096200 0 0 0 0
1267095900 0 0 0 0
1267095600 0 0 0 0 |
I compared it with http://www.land10.nl/apachestatus/apache-busyworkers.log and it looks totally different than mine apache-busyworkers.log (i know that it will not look exactly the same
It seems that counters are not working properly if .log files contains so much 0s, and this is the reason of empty graphs. How should i fix it ?
ApacheStats.log :
Code: |
2010-02-25 14:45:55 -- 2010-02-25 14:40:54: WARNING: Problem with External get 'perl apache.pl none taccesses -conf Apache.ini':
Expected a Number for 'in' but nothing'
2010-02-25 14:45:55 -- 2010-02-25 14:40:54: WARNING: Problem with External get 'perl apache.pl none taccesses -conf Apache.ini':
Expected a Number for 'out' but nothing'
2010-02-25 14:45:55 -- 2010-02-25 14:40:54: WARNING: Could not get any data from external command 'perl apache.pl none tkbytes -conf Apache.ini'
Maybe the external command did not even start. (Inappropriate I/O control operation)
2010-02-25 14:45:55 -- 2010-02-25 14:40:54: WARNING: Problem with External get 'perl apache.pl none tkbytes -conf Apache.ini':
Expected a Number for 'in' but nothing'
2010-02-25 14:45:55 -- 2010-02-25 14:40:54: WARNING: Problem with External get 'perl apache.pl none tkbytes -conf Apache.ini':
Expected a Number for 'out' but nothing'
2010-02-25 14:45:55 -- 2010-02-25 14:40:54: WARNING: Could not get any data from external command 'perl apache.pl none busyworkers -conf Apache.ini'
Maybe the external command did not even start. (Inappropriate I/O control operation)
2010-02-25 14:45:55 -- 2010-02-25 14:40:54: WARNING: Problem with External get 'perl apache.pl none busyworkers -conf Apache.ini':
Expected a Number for 'in' but nothing'
2010-02-25 14:45:55 -- 2010-02-25 14:40:54: WARNING: Problem with External get 'perl apache.pl none busyworkers -conf Apache.ini':
Expected a Number for 'out' but nothing'
2010-02-25 14:45:55 -- 2010-02-25 14:45:55: ERROR: Target[apache-taccesses][_IN_] ' $target->[1]{$mode} ' did not eval into defined data
2010-02-25 14:45:55 -- 2010-02-25 14:45:55: ERROR: Target[apache-taccesses][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data
2010-02-25 14:45:55 -- 2010-02-25 14:45:55: ERROR: Target[apache-tkbytes][_IN_] ' $target->[2]{$mode} ' did not eval into defined data
2010-02-25 14:45:55 -- 2010-02-25 14:45:55: ERROR: Target[apache-tkbytes][_OUT_] ' $target->[2]{$mode} ' did not eval into defined data
2010-02-25 14:45:55 -- 2010-02-25 14:45:55: ERROR: Target[apache-busyworkers][_IN_] ' $target->[3]{$mode} ' did not eval into defined data
2010-02-25 14:45:55 -- 2010-02-25 14:45:55: ERROR: Target[apache-busyworkers][_OUT_] ' $target->[3]{$mode} ' did not eval into defined data |
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Thu 25 Feb '10 20:32 Post subject: |
|
|
Look in apache.cache file for the Apache response.
Steffen |
|
Back to top |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Thu 25 Feb '10 20:37 Post subject: |
|
|
In both cases apache.cache is the same :
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="https://www.localhost/server-status?auto">here</a>.</p>
</body></html> |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Thu 25 Feb '10 21:07 Post subject: |
|
|
Yep, then you get no stats.
Do you have in apache.ini ?
$host = "localhost";
$port ="80";
What happens when you type in your browser http://localhost:80/server-status?auto
Steffen |
|
Back to top |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Thu 25 Feb '10 21:22 Post subject: |
|
|
Steffen wrote: | Yep, then you get no stats.
Do you have in apache.ini ?
$host = "localhost";
$port ="80";
|
Yes i have it.
On WinXP :
Code: |
Total Accesses: 1493
Total kBytes: 10697
Uptime: 17715
ReqPerSec: .0842789
BytesPerSec: 618.331
BytesPerReq: 7336.72
BusyWorkers: 1
IdleWorkers: 63
Scoreboard: ___
|
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Thu 25 Feb '10 22:13 Post subject: |
|
|
That looks fine.
What do you get when you type in a DOS box:
Code: |
YOUR PATH\ApacheStats\bin>curl -m 10 http://localhost:80/server-status?auto -A "ApacheLounge Monitor" |
AND
Code: |
YOUR PATH\ApacheStats\bin>perl apache.pl none taccesses |
Steffen |
|
Back to top |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Thu 25 Feb '10 22:43 Post subject: |
|
|
Steffen wrote: | That looks fine.
What do you get when you type in a DOS box:
Code: |
YOUR PATH\ApacheStats\bin>curl -m 10 http://localhost:80/server-status?auto -A "ApacheLounge Monitor" |
|
Code: |
C:\ApacheStats\bin>curl -m 10 http://localhost:80/server-status?auto -A "ApacheL
ounge Monitor"
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>301 Moved Permanently</title>
</head><body>
<h1>Moved Permanently</h1>
<p>The document has moved <a href="http://localhost/server-status/?auto">here</a
>.</p>
</body></html> |
Steffen wrote: |
Code: |
YOUR PATH\ApacheStats\bin>perl apache.pl none taccesses |
Steffen |
Code: |
C:\ApacheStats\bin>perl apache.pl none taccesses
C:\ApacheStats\bin>
|
|
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3092 Location: Hilversum, NL, EU
|
Posted: Thu 25 Feb '10 22:52 Post subject: |
|
|
Strange, the return from Apache is "301 Moved Permanently", so Apache is redirecting. Further all looks fine.
What is your first vhost ?
I Have:
<VirtualHost *>
ServerName YOUR Computer Name
DocumentRoot YOUR Path.
</VirtualHost>
What happens when you put in the apache.ini your domain:
$host = "www.YOUR Domain.com";
$port ="80";
Steffen |
|
Back to top |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Fri 26 Feb '10 0:04 Post subject: |
|
|
Steffen wrote: | Strange, the return from Apache is "301 Moved Permanently", so Apache is redirecting. Further all looks fine.
What is your first vhost ?
I Have:
<VirtualHost *>
ServerName YOUR Computer Name
DocumentRoot YOUR Path.
</VirtualHost>
What happens when you put in the apache.ini your domain:
$host = "www.YOUR Domain.com";
$port ="80";
Steffen |
I will not put mydomain.com into apache.ini couse server-status document is protected to be readed only from localhost by Order and Allow directive so it's pointless in my opinion.
But take a look on it :
Code: | C:\ApacheStats\bin>curl -m 10 http://localhost/server-status?auto -A "ApacheLounge Monitor"
Total Accesses: 1957
Total kBytes: 13975
Uptime: 27459
ReqPerSec: .0712699
BytesPerSec: 521.155
BytesPerReq: 7312.42
BusyWorkers: 1
IdleWorkers: 63
Scoreboard:
C:\ApacheStats\bin> |
So i just have changed this
Code: | C:\ApacheStats\bin>curl -m 10 http://localhost/server-status?auto -A "ApacheLounge Monitor" |
to
Code: | C:\ApacheStats\bin>curl -m 10 http://localhost/server-status/?auto -A "ApacheLounge Monitor" |
and i think this is expected result, am I right ? |
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
Posted: Fri 26 Feb '10 0:11 Post subject: |
|
|
Understand that you do not want to test with your domain.
But, the output looks good now, so it should work
Steffen |
|
Back to top |
|
admin Site Admin
Joined: 15 Oct 2005 Posts: 692
|
Posted: Fri 26 Feb '10 0:14 Post subject: |
|
|
Try to add the / in apache.pl in the curl call.
Please do not edit your post, I missed it first.
Steffen |
|
Back to top |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Fri 26 Feb '10 11:18 Post subject: |
|
|
admin wrote: | Try to add the / in apache.pl in the curl call.
Please do not edit your post, I missed it first.
Steffen |
First of all i would like to say that many others forums required editing post for additional comments than creating new one if none has answered. That's why i edited it but i understand that you could miss it.
But let's go back to my issue. Now it's working fine on WindowsXP. My first mistake was that i didn't enable /server-status on httpd.conf (mod_status module has been uncomment but /server-status alias hasn't been enabled). Another mistake was that i disallowed access to /server-status by Order "command" even from localhost. But the most curious problem was that i didn't check proper directory for the files (htmls and logs) !!!!!!
WorkDir was C:\wamp\www\stats\ and i was checking c:\wamp\www\server-status. I'm so shame about it !!!
Currently my log files are clean and everything is working on WinXP machine. Today i will do the same on Win2k3 and let u know if it's working. Thanks for your help - it was really priceless ! |
|
Back to top |
|