
Apache Statistics - MySQL Add-on Version 1.1

Change Log:

1.1  9 August 2011      
     Made call to mysql more efficent 
     and now use Queries instead of Questions variable.
1.0  25 March 2008
     First version

_______________________________________________________

Author: Steffen (info@apachelounge.com)
_______________________________________________________

First you must have:

- a running Apache Statistics from the Apache Lounge
- a running Apache with PHP

1. Copy mysql.pl to de ApacheStats bin folder


2. Edit line 3 of mysql.php for your MySQL Host, User and Password

   line 3:     $link = mysql_connect('127.0.0.1', 'user', 'password');


3. Copy mysql.php to your Apache web space (WebRoot of your Server), 
   this php file is called with the host and port as
   specified in Apache.ini, default is http://localhost:80/mysql.php


4. Add to bottom of mrtg.ini 

Target[mysql-questions]: `perl mysql.pl none questions -conf Apache.ini`
PageTop[mysql-questions]: <h2><font color=#006633>Mysql Queries per Second</font></h2>
Title[mysql-questions]: Mysql Queries
Options[mysql-questions]:   growright, nopercent, noinfo, nobanner, integer,noi
MaxBytes[mysql-questions]: 124
WithPeak[mysql-questions]: wmy
YLegend[mysql-questions]: queries/sec
ShortLegend[mysql-questions]: queries/sec
LegendI[mysql-questions]: 
LegendO[mysql-questions]: &nbsp;
Legend2[mysql-questions]: Queries per second
Legend4[mysql-questions]: Maximal 5 Minute Queries


5. When you have not that many queries,you can use 
   units per hour instead of units per second for 
   more accurate graphs (you can have both per second and per hour).

   Add to bottom of mrtg.ini for per hour:

Target[mysql-questions-h]: `perl mysql.pl none questions -conf Apache.ini`
PageTop[mysql-questions-h]: <h2><font color=#006633>Mysql Queries per Hour</font></h2>
Title[mysql-questions-h]: Mysql Queries
Options[mysql-questions-h]:   growright, nopercent, nobanner, noinfo, integer, noi, perhour
MaxBytes[mysql-questions-h]: 160000
WithPeak[mysql-questions-h]: wmy
YLegend[mysql-questions-h]: queries/hour
ShortLegend[mysql-questions-h]: queries/hour
LegendI[mysql-questions-h]: 
LegendO[mysql-questions-h]: &nbsp;
Legend2[mysql-questions-h]: Queries per hour
Legend4[mysql-questions-h]: Maximal 5 Minute Queries


Tip: See also the notes in the Readme.txt of ApacheStats.zip from the Apache Lounge.

_______________________________________________________

Toubleshooting: 
Look in Stats.log for errors and for the
MySQL response in the mysql.cache file.
_______________________________________________________


Enjoy,

Steffen


Legal Jargon:
This program is distributed in the hope that it will be useful,
but without any warranty; without even the implied warranty of
merchantability or fitness for a paricular purpose. 






