SF has removed the small attachment - here is the script:
#!/usr/local/bin/perl
use strict;
use IO::Socket;
my $nachricht;
my $file="maillog.txt";
my $azeilen=0;
my $i=0;
my @zeilen;
my $a;
my $port;
my $sl;
open F, "<assp.cfg" or die "unable to find assp.cfg";
@zeilen=<F>;
close F;
foreach $a (@zeilen) {
($sl,$port) = split("=",$a) if ($a =~ /sysLogPort/);
}
die "sysLogPort in assp.cfg not found" if (!$port);
if (open F, "<$file") {
@zeilen=<F>;
close F;
$azeil...@zeilen;
$i = $azeilen - 60;
$i = 0 if ($i < 0);
for ($a=$i;$a<$azeilen;$a++) {
print @zeilen[$a];
}
}
my $socket = IO::Socket::INET->new(
Proto => "udp",
LocalPort => $port,
ReuseAddr => 1,
)
or die "problem: $!";
while ($socket->recv($nachricht, 1024)) {
chomp($nachricht);
my $m=localtime();
$m=~s/^... (...) +(\d+) (\S+) ..(..)/$1-$2-$4 $3/;
$nachricht =~ s/^\<.*\]\: //;
print "$m $nachricht\n";
}
Thomas
DISCLAIMER:
*******************************************************
This email and any files transmitted with it may be confidential, legally
privileged and protected in law and are intended solely for the use of the
individual to whom it is addressed.
This email was multiple times scanned for viruses. There should be no
known virus in this email!
*******************************************************
------------------------------------------------------------------------------
Register Now & Save for Velocity, the Web Performance & Operations
Conference from O'Reilly Media. Velocity features a full day of
expert-led, hands-on workshops and two days of sessions from industry
leaders in dedicated Performance & Operations tracks. Use code vel09scf
and Save an extra 15% before 5/3. http://p.sf.net/sfu/velocityconf
_______________________________________________
Assp-test mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/assp-test