logo
Apache Lounge
Webmasters

 


About

Forum Index Downloads Search Register Log in  RSS Apache Lounge
 



Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Apache Lounge is not sponsored.

Your donations will help to keep this site alive and well, and continuing building binaries.



Apache MRTG Statistics Setup & Use

 
Post new topic   Reply to topic    Apache Forum Index -> Apache Webmaster Tools & Utilities



View previous topic :: View next topic  
Author Message
ArtM



Joined: 23 Feb 2006
Posts: 59
Location: Bedford NS Canada

PostPosted: Sun 09 Apr '06 19:30    Post subject: Apache MRTG Statistics Setup & Use Reply with quote

A few Questions re Statistics Add-On:

Quote:
Steffen wrote:
I made a perl script that interfaces the output from mod_status with mrtg.

You can view the historical data, that allows you analyze patterns of usage and set a operative baseline. For example, it enables you to know exactly how busy the Apache Server is.

See an example at: http://www.land10.nl/apachestatus/

Please test it and post your experience. Also let me know if the readme.txt is clear. Download at: http://www.apachelounge.com/download/ApacheStats.zip .

Steffen



I Tried this out.



Quote:
9. Start the stats by double clicking on StartStats.bat and a Dos
box appears



Question 1:

How do I get this to start automatically with Apache and/or system startup?
And how to start & keep running without keeping the DOS box open? Is it Possible?
Yet be able to take it down when I want. How to Stop?

Question 2:

The statistics seem to start at non-zero levels. e.g., in Accesses - 360/hr, 444/mth, 444/yr. How do I 'Zero' them out to start?

Question 3:

If Apache is set to Listen to other ports, is it possible to monitor statistics for those ports as well? Or will they be included in the port 80 stats? Or will other port Listens interfere with main port 80 stats?

Question 4:

Are the statistics retained from restart to restart of Apache? How to do this to keep them running over time?
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2536
Location: Hilversum, NL, EU

PostPosted: Sun 09 Apr '06 20:07    Post subject: Reply with quote

1)
How to setup mrtg as a windows service, see the official MRTG site at http://people.ee.ethz.ch/~oetiker/webtools/mrtg/doc/mrtg-nt-guide.en.html

I have also the Sambar server running on my box, Sambar has a CRON-job features and this calls evry 5 minutes the statistics.

2)
The statistics are calling Apache every 5 minutes and that is also counted.

3)
They are included.

4)
Yes they are retainded from (re)start to (re)start. Keep it running, see answer 1 above (running as service).


Steffen
Back to top
ArtM



Joined: 23 Feb 2006
Posts: 59
Location: Bedford NS Canada

PostPosted: Mon 10 Apr '06 0:14    Post subject: Reply with quote

Thanks for the reply Steffen.

Does the directory that contains the Stats program have to be underneath Apache or in any particular location??
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2536
Location: Hilversum, NL, EU

PostPosted: Mon 10 Apr '06 12:55    Post subject: Reply with quote

It is advised to put the Apachestats folder (with the bin and lib) outside the Apache folder. Of course the folder with the generated html and pic's must be in your web space.


Steffen
Back to top
ess



Joined: 05 Jun 2007
Posts: 1

PostPosted: Tue 05 Jun '07 13:26    Post subject: ApacheStats Setup & Use Reply with quote

I am writing from Italy.

Installing ApacheStats I encountered problems. I followed step by step the readme.txt file.
Starting StartStats.bat a DOS box appears and in the Stats.log I found followin errors:


2007-06-05 12:37:46 -- Started mrtg with config 'mrtg.ini'
2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Could not get any data from external command 'perl apache.pl none taccesses -conf Apache.ini'
Maybe the external command did not even start. ()

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none taccesses -conf Apache.ini':
Expected a Number for 'in' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none taccesses -conf Apache.ini':
Expected a Number for 'out' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: 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. ()

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none tkbytes -conf Apache.ini':
Expected a Number for 'in' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none tkbytes -conf Apache.ini':
Expected a Number for 'out' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: 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. ()

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none busyworkers -conf Apache.ini':
Expected a Number for 'in' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none busyworkers -conf Apache.ini':
Expected a Number for 'out' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: ERROR: Target[apache-taccesses][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
2007-06-05 12:37:46 -- 2007-06-05 12:37:46: ERROR: Target[apache-taccesses][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data
2007-06-05 12:37:47 -- 2007-06-05 12:37:46: ERROR: Target[apache-tkbytes][_IN_] ' $target->[1]{$mode} ' did not eval into defined data
2007-06-05 12:37:47 -- 2007-06-05 12:37:46: ERROR: Target[apache-tkbytes][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data
2007-06-05 12:37:47 -- 2007-06-05 12:37:46: ERROR: Target[apache-busyworkers][_IN_] ' $target->[2]{$mode} ' did not eval into defined data
2007-06-05 12:37:47 -- 2007-06-05 12:37:46: ERROR: Target[apache-busyworkers][_OUT_] ' $target->[2]{$mode} ' did not eval into defined data

I appreciate any help. Thanks
Back to top
xmih



Joined: 19 Sep 2007
Posts: 1

PostPosted: Wed 19 Sep '07 13:19    Post subject: Re: ApacheStats Setup & Use Reply with quote

Hello. Please answer how resolve this problem?
I think, its because modsecurity is blocking /server-status.
How modify modsecurity rules to accept /server-status?

Thank you.

ess wrote:
I am writing from Italy.

Installing ApacheStats I encountered problems. I followed step by step the readme.txt file.
Starting StartStats.bat a DOS box appears and in the Stats.log I found followin errors:


2007-06-05 12:37:46 -- Started mrtg with config 'mrtg.ini'
2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Could not get any data from external command 'perl apache.pl none taccesses -conf Apache.ini'
Maybe the external command did not even start. ()

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none taccesses -conf Apache.ini':
Expected a Number for 'in' but nothing'

I appreciate any help. Thanks
Back to top
bentogoa



Joined: 09 Feb 2007
Posts: 66
Location: GOA

PostPosted: Wed 19 Sep '07 17:14    Post subject: RAM & mysql stats missing? Reply with quote

The ApacheStats i downloaded for here does not have RAM and MYSQL pages. as the on on http://www.land10.nl/apachestatus/ has.

To install ApacheStats as a service is easy
Download this files
http://www.electrasoft.com/srvany/instsrv.exe
http://www.electrasoft.com/srvany/srvany.exe
And copy them in the F:/apachestats/bin/ directory.
NOTE REPLACE THE DRIVE LETTER AND PATH TO MATCH YOUR INSTALLATION

copy and paste the following in a new notepad file and name the file something.reg
(DO NOT OPEN IT AT THIS STEP)
Code:

 Windows Registry Editor Version 5.00

 [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRTG\Parameters]
 "Application"="F:\\perl\\bin\\wperl.exe"
 "AppParameters"="F:\\apachestats\\bin\\mrtg.pl --logging=eventlog F:\\apachestats\\bin\\mrtg.ini"
 "AppDirectory"="F:\\apachestats\\bin\\"


Start > Run > cmd
Code:

cd "F:\apachestats\bin"

Code:

instsrv MRTG F:\apachestats\bin\srvany.exe


right click on the created something.reg file and select merge.

Start -> Run -> regedt32

and locate the [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRTG] key. Make sure that the ImagePath variable is correctly pointing to srvany.exe located in your MRTG bin directory (for example F:\apachestats\bin\srvany.exe). Next you have to expand the MRTG tree, and go to the [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MRTG\Parameters] key. Under Parameters make sure that all the Application variables are setup properly.

Bento Fernandes
http://www.goanwap.com
Back to top
upthegut34



Joined: 12 Feb 2008
Posts: 5

PostPosted: Thu 18 Dec '08 3:23    Post subject: Re: ApacheStats Setup & Use Reply with quote

ess wrote:
I am writing from Italy.

Installing ApacheStats I encountered problems. I followed step by step the readme.txt file.
Starting StartStats.bat a DOS box appears and in the Stats.log I found followin errors:


2007-06-05 12:37:46 -- Started mrtg with config 'mrtg.ini'
2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Could not get any data from external command 'perl apache.pl none taccesses -conf Apache.ini'
Maybe the external command did not even start. ()

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none taccesses -conf Apache.ini':
Expected a Number for 'in' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none taccesses -conf Apache.ini':
Expected a Number for 'out' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: 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. ()

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none tkbytes -conf Apache.ini':
Expected a Number for 'in' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none tkbytes -conf Apache.ini':
Expected a Number for 'out' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: 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. ()

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none busyworkers -conf Apache.ini':
Expected a Number for 'in' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: WARNING: Problem with External get 'perl apache.pl none busyworkers -conf Apache.ini':
Expected a Number for 'out' but nothing'

2007-06-05 12:37:46 -- 2007-06-05 12:37:46: ERROR: Target[apache-taccesses][_IN_] ' $target->[0]{$mode} ' did not eval into defined data
2007-06-05 12:37:46 -- 2007-06-05 12:37:46: ERROR: Target[apache-taccesses][_OUT_] ' $target->[0]{$mode} ' did not eval into defined data
2007-06-05 12:37:47 -- 2007-06-05 12:37:46: ERROR: Target[apache-tkbytes][_IN_] ' $target->[1]{$mode} ' did not eval into defined data
2007-06-05 12:37:47 -- 2007-06-05 12:37:46: ERROR: Target[apache-tkbytes][_OUT_] ' $target->[1]{$mode} ' did not eval into defined data
2007-06-05 12:37:47 -- 2007-06-05 12:37:46: ERROR: Target[apache-busyworkers][_IN_] ' $target->[2]{$mode} ' did not eval into defined data
2007-06-05 12:37:47 -- 2007-06-05 12:37:46: ERROR: Target[apache-busyworkers][_OUT_] ' $target->[2]{$mode} ' did not eval into defined data

I appreciate any help. Thanks


Hi,

I'm attempting to setup and am getting the exact same errors.

Anybody figured this out yet?

Thanks
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2536
Location: Hilversum, NL, EU

PostPosted: Thu 18 Dec '08 21:28    Post subject: Reply with quote

Look in the file apache.cache for the Apache response.

Steffen
Back to top
upthegut34



Joined: 12 Feb 2008
Posts: 5

PostPosted: Sun 21 Dec '08 6:38    Post subject: Reply with quote

Thanks Steffan.

Sure enough, there was a response in there.

Quote:
403 Forbidden
You don't have permission to access /server-status on this server.


I'm not sure exactly where this is or where I need to adjust the lacking permission.

Will try again in the morning.
Back to top
upthegut34



Joined: 12 Feb 2008
Posts: 5

PostPosted: Sat 28 Mar '09 18:47    Post subject: Reply with quote

I'd put this off and forgotten about it. Now I'm trying again. Smile

Anyway, the text inside the apache.cache file that I quoted above seems to simply be static html.

Code:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /server-status
on this server.</p>
</body></html>


I have no trouble accessing the pages themselves. The graphs show up fine. Just no data populating them. I'm getting the same errors in Stats.log as before.

Any ideas?

Thanks
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 2536
Location: Hilversum, NL, EU

PostPosted: Sat 28 Mar '09 19:15    Post subject: Reply with quote

Adjust the premissions (standard deny) in ..conf/extra/httpd-info.conf

<Location /server-status>
SetHandler server-status
Order deny,allow
Deny from all
Allow from .example.com
</Location>

Steffen
Back to top
TXPsycho



Joined: 24 Nov 2012
Posts: 1
Location: Seattle,WA

PostPosted: Tue 27 Nov '12 2:35    Post subject: Testing Apache stats Reply with quote

I have an apache server used for personal / development uses... its not very active however i tested out apache stats installed from the zip using the readme instructions exactly.

Server Version: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7

Works exactly as advertised.
Well done and completely painless.
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 536

PostPosted: Tue 27 Nov '12 16:08    Post subject: Reply with quote

Good to hear, get minor feedback and I think quite some are using it. Mostly when it is working we do not get feedback.

Thanks!

Steffen
Back to top
Qmpeltaty



Joined: 06 Feb 2008
Posts: 182
Location: Poland

PostPosted: Tue 17 Jun '14 9:11    Post subject: Re: Testing Apache stats Reply with quote

TXPsycho wrote:
I have an apache server used for personal / development uses... its not very active however i tested out apache stats installed from the zip using the readme instructions exactly.

Server Version: Apache/2.4.3 (Win32) OpenSSL/1.0.1c PHP/5.4.7

Works exactly as advertised.
Well done and completely painless.


Out of the topic - update your SSL to 1.0.1g
Back to top
Jan-E



Joined: 09 Mar 2012
Posts: 780
Location: Amsterdam, NL, EU

PostPosted: Wed 18 Jun '14 9:37    Post subject: Reply with quote

1.0.1h is the most recent one.
Back to top


Post new topic   Reply to topic    Apache Forum Index -> Apache Webmaster Tools & Utilities
Page 1 of 1