[imp] analyse horde logs - RRD-Tool?

Oliver Kuhl okuhl at netcologne.de
Tue Apr 29 10:46:54 PDT 2003


Hi!

> is there any software in order to easily analyse the Horde's logs ?
I don't know. But if you want to see stats, I created a neat rrd-tool graphic which shows the different apps that are used. I greps a bit out of apache's access.log.

Just look at the image, to get an idea. ;-)

I attached my scripts. The create*-script creates the rrdatabase. Updatedata updates the data in the db. This one has to be called by cron. Updategraph creates the images. I use it with a php-script that only updates the graphics, if there is never data in the db. This looks like the following:

<?php
$module = "apachehits";

$lastupdate_timestamp      = filectime("../data/".$module.".rrd");
$lastupdategraph_timestamp = filectime("../images/".$module."-week.gif");
$lastupdate                = date("d.m.Y H:i:s", $lastupdate_timestamp);
$lastupdategraph           = date("d.m.Y H:i:s", $lastupdategraph_timestamp);

//echo("rrd: $lastupdate_timestamp(".date("d.m.Y H:i:s", $lastupdate_timestamp).")<br>");  
//echo("graph: $lastupdategraph_timestamp(".date("d.m.Y H:i:s", $lastupdategraph_timestamp).")<br>");

if($lastupdate_timestamp > $lastupdategraph_timestamp) {
    echo("Erstelle Grafiken...<br>");
    flush();
    exec("../scripts/".$module."_updategraph.sh day");
    ?><IMG src="../images/<?php echo($module); ?>-day.gif" alt="Daily Stats" border=0><br><?php
    flush();
    exec("../scripts/".$module."_updategraph.sh week");
    ?><IMG src="../images/<?php echo($module); ?>-week.gif" alt="Weekly Stats" border=0><br><?php
    flush();
    exec("../scripts/".$module."_updategraph.sh month");
    ?><IMG src="../images/<?php echo($module); ?>-month.gif" alt="Monthly Stats" border=0><br><?php
    flush();
    exec("../scripts/".$module."_updategraph.sh year");
    ?><IMG src="../images/<?php echo($module); ?>-year.gif" alt="Yearly Stats" border=0><br><?php
    echo("fertig.<br>");
} else {
   ?>
   <IMG src="../images/<?php echo($module); ?>-day.gif" alt="Daily Stats" border=0><br>
   <IMG src="../images/<?php echo($module); ?>-week.gif" alt="Weekly Stats" border=0><br>
   <IMG src="../images/<?php echo($module); ?>-month.gif" alt="Monthly Stats" border=0><br>
   <IMG src="../images/<?php echo($module); ?>-year.gif" alt="Yearly Stats" border=0><br>
   <?php
}
?>

Take care of the rights. The updategraph-script must be executable for your webserver as well as the webserver must be able to read the db and of course be able to write the images.

Enjoy.

Gruss,
   Ollie.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apachehits_updatedata.sh
Type: application/x-sh
Size: 855 bytes
Desc: not available
Url : http://lists.horde.org/archives/imp/attachments/20030429/6605c61f/apachehits_updatedata-0001.sh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apachehits_updategraph.sh
Type: application/x-sh
Size: 4047 bytes
Desc: not available
Url : http://lists.horde.org/archives/imp/attachments/20030429/6605c61f/apachehits_updategraph-0001.sh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: create_apachehits.sh
Type: application/x-sh
Size: 608 bytes
Desc: not available
Url : http://lists.horde.org/archives/imp/attachments/20030429/6605c61f/create_apachehits-0001.sh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: apachehits-day.gif
Type: image/gif
Size: 20006 bytes
Desc: not available
Url : http://lists.horde.org/archives/imp/attachments/20030429/6605c61f/apachehits-day-0001.gif


More information about the imp mailing list