Usage
Include the LOGCHECK class into your perl script and create a new instance:
$log = LOGCHECK->new('/path/to/sendmail.log');
You can set the number of entries in the top ranking (default is 10) with this variable:
$log->{entries} = 30;
You can set the following filters to tweak your report, using regular expressions:
$log->{filter}{from} = 'user1@isp1'; # sender's e-mail address
$log->{filter}{to} = 'user2@isp2'; # recipient's e-mail address
$log->{filter}{stat} = 'deferred|timout'; # status
Status can be "sent", "deferred", "user unknown", "host unknown", "service unavailable",
"timeout", "queued", etc.
You can change the look of your HTML report by adapting several variables, for example:
$log->{titleFont} = 'Comic Sans MS';
$log->{graphBorder} = '1px solid #D00000';
$log->{cellBGColor} = '#FFF0E0';
If you want an ASCII report instead, change this variable (default is HTML):
$log->{format} = 'ASCII';
Finally create the report:
print $log->report();
Comments
|