Apache-Logmonster

 view release on metacpan or  search on metacpan

bin/logmonster.pl  view on Meta::CPAN


=item * Ouputs to webalizer, http-analyze, and AWstats.

=item * Automatic vhost detection 

Logmonster generates config files as required (ie, awstats.example.com.conf).

=item * Efficient

Reads directly from compressed log files to minimize network and disk usage. Skips sorting if you only have logs from a single host.

=item * Flexible update intervals

runs monthly, daily, or hourly

=item * Reporting

logs an activity report and sends an email friendly report.

=item * Reliable

When something goes wrong, it provides useful error messages.

=back


=head1 INSTALLATION

=over

=item Step 1 - Download and install (it's FREE!)

https://www.tnpi.net/cart/index.php?crn=210&rn=385&action=show_detail

Install like typical perl modules:

   perl Makefile.PL
   make test
   make install 

To install the config file, 'make conf' or 'make newconf'. The newconf target will overwrite any existing config file.

=item Step 2 - Edit logmonster.conf

 vi /usr/local/etc/logmonster.conf

=item Step 3 - Edit your web servers config

=over 4 

=item Apache

Adjust the CustomLog and ErrorLog definitions. We make two changes, appending %v (the vhost name) to the CustomLog and adding cronolog to automatically rotate the log files.

  LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %v" combined
  CustomLog "| /usr/local/sbin/cronolog /var/log/apache/%Y/%m/%d/access.log" combined
  ErrorLog "| /usr/local/sbin/cronolog /var/log/apache/%Y/%m/%d/error.log"

=item Lighttpd

 accesslog.format = "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %v"
 accesslog.filename = "|/usr/local/sbin/cronolog /var/log/http/%Y/%m/%d/access.log"
 server.errorlog  = "/var/log/http/error.log"

=back

=item Step 4 - Test manually, then add to cron.

  crontab -u root -e
  5 1 * * * /usr/local/sbin/logmonster -i day

=item Step 5 - Read the FAQ

L<http://tnpi.net/wiki/Logmonster_FAQ>

=item Step  6 - Enjoy

Enjoy the daily summary emails.

=back


=head1 DIAGNOSTICS

Run in verbose mode (-v) to see additional status and error messages. Verbosity can be increased by appending another -v, or even (-v -v -v) maximal verbosity. If that is not enough, the source is with you.

Also helpful when troubleshooting is the ability to skip cleanup (so logfiles do not have to be fetched anew) with the --noclean command line option.


=head1 DEPENDENCIES

Not perl builtins

  Compress::Zlib
  Date::Parse (TimeDate)
  Params::Validate

Builtins

  Carp
  Cwd
  FileHandle
  File::Basename
  File::Copy


=head1 BUGS AND LIMITATIONS

Report problems to author. Patches welcome.


=head1 AUTHOR
 
Matt Simerson  (msimerson@cpan.org)
 

=head1 ACKNOWLEDGEMENTS

 Gernot Hueber - sumitted the daily userlogs feature
 Lewis Bergman - funded authoring of several features
 Raymond Dijkxhoorn - suggested not sorting the files for one log host
 Earl Ruby  - a better regexp for apache log date parsing



( run in 0.753 second using v1.01-cache-2.11-cpan-acf6aa7dc9e )