Cover Sheets?

Francis J. Lacoste flacoste at logreport.org
Fri Feb 21 20:54:08 CET 2003


On mer, 2003-02-19 at 18:40, Stewart James wrote:
> I figured I could create various cronjobs to make the reports, however,
> something I know managers like is a overall coversheet, (sample at
> http://news.its.vu.edu.au/reports/ ).
> 
> does lire have this ability. I also use another application for squid logs
> that produces a similar coversheet. It would be excellent if I could do
> one for for each service I will have lire reporting on.

Unfortunately Lire doesn't offer that functionality. I've added
that feature request to our TODO list. (It's a very nice functionality
indeed).

If you are confortable with perl scripting, here are a few hints on
how you can implement that feature yourself as part of your CRON script.

>From you cron script, you generate your daily reports in the XML format
which you save in your web hierarchy:

reports/

  squid/

    030215.xml
    030216.xml
    ....

  combined/

    ...

Or whatever hierarchy you need. You can then generate the HTML reports 
using lr_xml2report -i -o html command.

The cover sheet (squid/index.html) could then be generated using
a custom script which parses the XML report and generate that
cover sheet you want. You can use the Lire::Report(3pm) and
Lire::ReportParser::BuildReport(3pm) interface to achieve that.

Sample (untested and without error checking) example:

my $parser = new Lire::ReportParser::ReportBuilder;
open INDEX, "> $dir/index.html";
opendir DIR, "$dir";
foreach my $r ( readdir $dir ) {
   next unless $r =~ /\.xml$/;
   my $report = $parser->parsefile( "$dir/$r" );
  
   # ... find the data/subreport you need and print it in
   # your cover sheet.
}


Thanks for your interest in LogReport, kind regards,

Francis J. Lacoste

-- 
Francis J. Lacoste              . .           http://www.logreport.org
/^LogReport$/               . .               flacoste at logreport.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.logreport.org/pipermail/questions/attachments/20030221/c5f22843/attachment.bin 


More information about the Questions mailing list