Mailing List Archive

Re: eximstats and gzipped logfiles
Hugh,
Which version of eximstats are you using ? Later versions use the
following code to handle gzipped files:

if (@ARGV) {
# Scan the input files and collect the data
foreach my $file (@ARGV) {
if ($file =~ /\.gz/) {
unless (open(FILE,"gunzip -c $file |")) {
print STDERR "Failed to gunzip -c $file: $!";
next;
}
}
elsif ($file =~ /\.Z/) {
unless (open(FILE,"uncompress -c $file |")) {
print STDERR "Failed to uncompress -c $file: $!";
next;
}
}
else {
unless (open(FILE,$file)) {
print STDERR "Failed to read $file: $!";
next;
}
}
#Now parse the filehandle, updating the global variables.
parse($parser,\*FILE);
}
}

Version 1.16 should do what you want and is available in the exim-4.05
distribution (it is downwardly compatible).

The latest version (1.18) is available from
http://www.cyberenet.net/~sten/eximstats
MD5: 66961bdb49aed47d671f889b5d0ae3ac
and has a few minor updates, as well as Joachim Wieland's graphical
chart plotting capability. You will need to modify the
'#!/usr/local/bin/perl' line at the top to point to where perl is
installed on your system.

Steve



> Eximstats doesn't cope wth gzipped log files on the command line,
> despite them being fairly standard as a result of exicyclog. A
> search of the archives revealed that it can summarize the files on
> STDIN so one can use gzip -dc to process them. Gzip -d (or gunzip)
> won't pass non-gzipped files straight through, it gives an error if
> the files are not in gzip or compressed format.
> <Lines Snipped>
> Hugh
Re: Re: eximstats and gzipped logfiles [ In reply to ]
On Thu, 27 Jun 2002, Steve Campbell wrote:

> Hugh,
> Which version of eximstats are you using ? Later versions use the
> following code to handle gzipped files:

The one with Exim 3.36.

>
> if (@ARGV) {
> # Scan the input files and collect the data
> foreach my $file (@ARGV) {
> if ($file =~ /\.gz/) {
[...]

Well, it didn't do this, so it's not new enough! Anyway, thanks
for letting me know this problem has gone. [.I'm glad I didn't take
the time to do this "properly" -- using /bin/sh or make a proper class
in Ruby! :-)]

>
> Version 1.16 should do what you want and is available in the exim-4.05
> distribution (it is downwardly compatible).

I've not found time to explore Exim 4 yet, it's on my list.

>
[other useful info trimmed. Thanks]
>
> Steve
>

Thank you,
Hugh