HylaFAX The world's
most advanced open source fax server
|
|
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
xferstats output and patch
I vaguely remember reading someone mentioning this problem with
xferstats(1) truncating domain-name output; ie:
~,2:35pm> /usr/local/sbin/xferstats.org
Warning, address clash, "rob@pinnacle.co.nz" and "rob@co.nz".
Sender Pages Time Pg/min Errs TypRate TypData
cam@co.nz 5 6:02 0.8 1 9600 1-D MR
jonc@co.nz 1 0:28 2.1 0 9600 1-D MR
neil@co.nz 8 3:43 2.2 1 14400 1-D MR
rob@co.nz 2 0:50 2.4 0 9600 1-D MR
rob@pinnacle.co.nz 2 0:32 3.8 0 9600 1-D MR
scott@co.nz 9 4:30 2.0 0 9600 1-D MR
-------------------------------------------------------------
Total 27 16:05 1.7 2
I'm not certain whether anyone's posted a fix to this, so here's a
not-so-elegant patch to xferstats(1) that fixes this. With the patch
applied the above output becomes:
~,2:27> /usr/local/sbin/xferstats
Sender Pages Time Pg/min Errs TypRate TypData
cam@pinnacle.co.nz 5 6:02 0.8 1 9600 1-D MR
jonc@pinnacle.co.nz 1 0:28 2.1 0 9600 1-D MR
neil@pinnacle.co.nz 8 3:43 2.2 1 14400 1-D MR
rob@pinnacle.co.nz 4 1:22 2.9 0 9600 1-D MR
scott@pinnacle.co.nz 9 4:30 2.0 0 9600 1-D MR
---------------------------------------------------------------
Total 27 16:05 1.7 2
Cheers.
--
Jonathan Chen e-mail : jonc@pinnacle.co.nz
Pinnacle Software Ltd Voice : +64.9.415.4460
Auckland, New Zealand Fax : +64.9.415.4250
--------------------------------------------------------------------
*** xferstats.org Tue Dec 10 11:41:40 1996
--- xferstats Wed May 28 16:16:28 1997
***************
*** 391,398 ****
#
# Strip hostname from multi-part domain name.
#
n = split(addr, domains, ".");
! if (n > 2) { # e.g. flake.asd.sgi.com
l = length(domains[1])+1;
addr = substr(addr, l+1, length(addr)-l);
key = user "@" addr;
--- 391,401 ----
#
# Strip hostname from multi-part domain name.
#
+ EOF
+ test "$MAPNAMES" = "yes" && echo 'p = split("'`hostname`'", hostname, ".");'
+ test "$MAPNAMES" = "yes" && $CAT<<'EOF'
n = split(addr, domains, ".");
! if (n > p - 1) { # e.g. flake.asd.sgi.com
l = length(domains[1])+1;
addr = substr(addr, l+1, length(addr)-l);
key = user "@" addr;