Chapter 4. Automating Lire

Table of Contents

Automatically Processing Log Files Using Cron
Configuring lr_cron
Using lr_cron within Cron

This chapter discusses various ways to configure Lire for generating periodical reports from your system logs.

Automatically Processing Log Files Using Cron

The easiest way to have Lire generate reports from the various log files available on your system is through a cron job. Lire includes a script called lr_cron which takes care of calling the appropriate batch of commands on the appropriate log files. The reports can be generated either in the ASCII format or in any other format, as long as they are supported by Lire and the required software packages are available on your system. During the lr_cron process, they are afterward sent to an email address of your choice or stored in a location of your filesystem. To use lr_cron, you have to configure you DLF stores using lire.

Configuring lr_cron

An lr_cron process has to be configured in two steps:

  • configuring the jobs related to a store

  • configuring cronjobs to run lr_cron on the specified stores at the specified frequency

The first step is achieved by executing the lire command. Open or create a DLF store using the Store->Open... or the Store->New... menu. You will then see a list of the Import jobs and the Report jobs configured in this store. Edit them suiting your needs and remember the period parameters you have indicated for each of those jobs.

The purpose of the Import jobs is to schedule imports of log files within the DLF store while Report jobs are the processes through which the gathered data are computed and rendered into a report, which in turn can parametrized and scheduled for sending.

Each time lr_cron runs on a store, it executes the Import jobs and the Report jobs in order, depending of the period of their schedule.

Using lr_cron within Cron

Installing cron jobs is really easy since the only parameters given to lr_cron are a period and a store. The lines to add to your crontab should look similar to:

0 0 * * * /usr/bin/lr_cron daily /var/lib/lire/www_store
0 0 * * 0 /usr/bin/lr_cron weekly /var/lib/lire/email_store
	    

Once activated like this, report(s) will be sent on a weekly and/or daily basis.