/usr/sbin/binkdlogstat is in binkd 0.9.11-1.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | #!/usr/bin/perl
# binkd log analizer ver 0.1 11 Jan 1999
# ver 0.2 15 May 2007
# * Sent and recv sizes now counts in KBytes
#
# Copyright 1999-2007 (c) Pavel Gulchouck <gul@lucky.net> 2:463/68
# Copyright 2007 (c) Pavel Vinogradov <Pavel.Vinogradov@nixdev.net> 2:5050/144
# License: BSD.
while (<>) {
chomp;
if (s/^. [0-9][0-9] [A-Za-z]+ [0-9:]+ \[([0-9]+)\]\s+//) {
$pid = $1;
} else {
next;
}
if (/^call to ([0-9:\/\.]+)\@/) {
$pid{$pid} = "out $1";
next;
}
if (/^addr: ([0-9:\/\.]+)\@\S+$/) {
$pid{$pid} = "in $1" unless (defined $pid{$pid});
next;
}
next unless defined($pid{$pid});
($addr) = $pid{$pid} =~ / ([0-9:\/\.]+)/;
$addr{$addr}=1;
if (/^unable to connect:/) {
$failedout{$addr}++;
delete($pid{$pid});
next;
}
if (/^rcvd: \S+ \(([0-9]+), ([0-9\.]+) CPS,/) {
$rcvfiles{$addr}++;
$rcvbytes{$addr}+=$1;
$time{$addr}+=$1/$2 unless ($2 == 0);
next;
}
if (/^sent: \S+ \(([0-9]+), ([0-9\.]+) CPS,/) {
$sentfiles{$addr}++;
$sentbytes{$addr}+=$1;
$time{$addr}+=$1/$2 unless ($2 == 0);
next;
}
if (/^done \((from|to) \S+, (OK|failed),/) {
if ($1 eq "from") {
if ($2 eq "OK") {
$okin{$addr}++;
} else {
$failedin{$addr}++;
}
} else {
if ($2 eq "OK") {
$okout{$addr}++;
} else {
$failedout{$addr}++;
}
}
delete ($pid{$pid});
next;
}
}
print <<EOF;
Addr In In Out Out KBytes KBytes Files Files Avg
OK Fail OK Fail sent recv sent recv CPS
=============================================================================
EOF
$format = "%-13s %5d %5d %5d %5d %9d %9d %5d %5d %7.2f\n";
foreach $addr (sort cmpaddr keys %addr) {
printf $format,
$addr, $okin{$addr}, $failedin{$addr},
$okout{$addr}, $failedout{$addr},
$sentbytes{$addr}/1024, $rcvbytes{$addr}/1024,
$sentfiles{$addr}, $rcvfiles{$addr},
$time{$addr} ? ($sentbytes{$addr}+$rcvbytes{$addr})/$time{$addr} : 0;
$totokin += $okin{$addr};
$totfailedin += $failedin{$addr};
$totokout += $okout{$addr};
$totfailedout += $failedout{$addr};
$totsentbytes += $sentbytes{$addr};
$totrcvbytes += $rcvbytes{$addr};
$totsentfiles += $sentfiles{$addr};
$totrcvfiles += $rcvfiles{$addr};
$tottime += $time{$addr};
}
print <<EOF;
=============================================================================
EOF
printf $format,
" Total", $totokin, $totfailedin, $totokout, $totfailedout,
$totsentbytes/1024, $totrcvbytes/1024, $totsentfiles, $totrcvfiles,
$tottime ? ($totsentbytes+$totrcvbytes)/$tottime : 0;
sub cmpaddr {
my ($zonea, $neta, $nodea, $pointa) = split (/[:\/\.]/, $a);
my ($zoneb, $netb, $nodeb, $pointb) = split (/[:\/\.]/, $b);
return ($zonea <=> $zoneb) || ($neta <=> $netb) ||
($nodea <=> $nodeb) || ($pointa<=> $pointb);
}
|