Have a look in the mailing list archives for this and other useful
utilities...
#!/usr/local/bin/perl5
#
# Script to check syslogs for PortMaster 3 disconnect reasons.
#
# Reads logs from standard in and writes info to standard out.
#
# by Chris Adams <cadams@ro.com>
# 26 Sep 1997
# http://ro.com/~cadams/files/pm3-discon.pl
#
# You can modify this at will, but please send me any improvements you
# make.
$discon{"normal"}=0;
while (<>) {
if (/LE-Terminate-Detail =(.+)$/) {
$reason = $1;
# The next set of lines makes this script ignore what can be considered
# "normal" disconnect reasons. Comment out or delete any you want
# reported.
if ($reason =~ "User Request - Admin Quit")
{$discon{"normal"}++;$total++;next;}
if ($reason =~ "Admin Reset") {$discon{"normal"}++;$total++;next;} ;
if ($reason =~ "Host Request") {$discon{"normal"}++;$total++;next;} ;
if ($reason =~ "User Request - PPP Term Ack")
{$discon{"normal"}++;$total++;next;} ;
if ($reason =~ "User Error - PPP NCP Active to Request")
{$discon{"normal"}++;$total++;next;} ;
if ($reason =~ "Idle Timeout") {$discon{"normal"}++;$total++;next;} ;
if ($reason =~ "Session Timeout")
{$discon{"normal"}++;$total++;next;} ;
if ($reason =~ "Login Timeout") {$discon{"normal"}++;$total++;next;} ;
if ($reason =~ "User Request - PPP Term Req")
{$discon{"normal"}++;$total++;next;} ;
if ($reason =~ "User Request - Normal LAPM Disconnect")
{$discon{"normal"}++;$total++;next;} ;
$discon{$reason} = 0 if (! $discon{$reason});
$discon{$reason} ++;
$total ++;
}
}
foreach $reason (sort {$discon{$b} <=> $discon{$a}} keys %discon) {
printf "%50s %5.2f%% %5d/%d\n", $reason, 100 * $discon{$reason} /
$total,
$discon{$reason}, $total;
}
------------------------------------------------------------------------
Mike Tancsa, tel +1 519 651 3400
Network Administrator, mike@sentex.net
Sentex Communications www.sentex.net
Cambridge, Ontario Canada
-
To unsubscribe, email 'majordomo@livingston.com' with
'unsubscribe portmaster-modems' in the body of the message.