[comp.unix.xenix] uusub for HDB uucp

jbayer@ispi.UUCP (Jonathan Bayer) (11/20/88)

Having just upgraded from Version 2 (?) uucp to HDB uucp, I was 
disappointed to find that the program uusub was not available.  I am 
wondering if anyone has a public-domain version which could be adapted
to HDB?  I use it to moniter the amount of data transmitted during certain
time periods, and as far as I can tell (I have RTFM) HDB does not supply
that information.  The HDB uulog program does not provide a summary, but a
full dump.  The uustat program  does not provide this info either.

Jonathan Bayer
Intelligent Software Products, Inc.

gary@mrklund.UUCP (Gary W. Marklund ) (11/21/88)

I called SCO about this and they said it was under development.
They put me on a list to receive it when it is available.  They also
said the 2.2.3 version would work in the meantime(?).

-- 
Gary Marklund         (415) 333-0658    uunet!mrklund!gary
Marklund Corporation, 122 Arbor Street, San Franicisco, CA  94131

jbayer@ispi.UUCP (Jonathan Bayer) (11/21/88)

In article <219@mrklund.UUCP>, gary@mrklund.UUCP (Gary W. Marklund ) writes:
> 
> I called SCO about this and they said it was under development.
> They put me on a list to receive it when it is available.  They also
> said the 2.2.3 version would work in the meantime(?).

SCO told me that it was unavailable.  They did not say that the 2.2.3 version
will work.  However, I have received a message from John Gayman which I 
reproduced below which will do most of  what I want.

Jonathan Bayer
Intelligent Software Products, Inc.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

From uunet!wa3wbu!john Mon Nov 21 04:14:33 1988
Received: from wa3wbu.UUCP by uunet.UU.NET (5.59/1.14) with UUCP 
	id AA21751; Sun, 20 Nov 88 14:52:02 EST
Received: by wa3wbu.UUCP (smail2.5)
	id AA06057; 20 Nov 88 09:28:01 EST (Sun)
To: ispi.UUCP!jbayer
Subject: Re: uusub for HDB uucp
In-Reply-To: your article <269@ispi.UUCP>
News-Path: uunet!ispi!jbayer
Message-Id: <8811200928.AA06057@wa3wbu.UUCP>
Date: 20 Nov 88 09:28:01 EST (Sun)
From: uunet!wa3wbu!john (John Gayman)

   I use the following scripts to generate a weekly totals report of data
sent to each system I communicate with. It could just as easily be run
more often for the same information. I have created a script called
"statlog". It has the following contents:


awk -f /usr/local/syslog_awk /usr/spool/uucp/.Admin/xferstats

   It looks at the xferstats file of HDB and runs it against the syslog_awk
file.  The syslog_awk looks like this:


#  USAGE: awk -f syslog_awk /usr/spool/uucp/SYSLOG
# An awk script for printing a pretty report of UUCP activities from the
# UUCP SYSLOG - Erik E. Fair	October 2, 1984
#
# v7 UUCP
$4 == "received" {
	sysname[$2] = $2;
	by_rec[$2] += $6;
	sec_rec[$2] += $8;
	sys_xf[$2] ++;
}
#
# 4.2 BSD UUCP
$5 == "received" {
	sysname[$2] = $2;
	by_rec[$2] += $7;
	sec_rec[$2] += $9;
	sys_xf[$2] ++;
}
#
# System V UUCP
$6 == "<-" {
	$1 = substr($1, 1, (index($1, "!") - 1));
	sysname[$1] = $1;
	by_rec[$1] += $7;
	sec_rec[$1] += $9;
	sys_xf[$1] ++;
}
#
# v7 UUCP
$4 == "sent" {
	sysname[$2] = $2;
	by_xmt[$2] += $6;
	sec_xmt[$2] += $8;
	sys_xf[$2] ++;
}
#
# 4.2 BSD UUCP
$5 == "sent" {
	sysname[$2] = $2;
	by_xmt[$2] += $7;
	sec_xmt[$2] += $9;
	sys_xf[$2] ++;
}
#
# System V UUCP
$6 == "->" {
	$1 = substr($1, 1, (index($1, "!") - 1));
	sysname[$1] = $1;
	by_xmt[$1] += $7;
	sec_xmt[$1] += $9;
	sys_xf[$1] ++;
}
END {
#
# print a report header
	printf("System     Xfers  Bytes rec  Bytes xmt   Connect  Avg Xf  Avg rec  Avg xmt\n")
	for(i in sysname) {
#
# sort report by most connect time (selection sort)
		first = 0;
		for(j in sysname) {
			if (sys_xf[j] > 0) {
				tmp1 = sec_xmt[j];
				tmp2 = sec_rec[j];
# Stupid AWK bug - needs a simple expression
				time = (tmp1 + tmp2);
				if (time > first) {
					first = time;
					sys = sysname[j];
				}
			}
		}
#
# 4.2 BSD awk seems to have problems. This check should not be necessary.
# Oddly enough, this problem also shows up in System V. WHY???
		if (sys_xf[sys] != 0) {
#
# time for some bean counting
			tmp1       = sec_xmt[sys];
			tmp2       = sec_rec[sys];
# Stupid AWK bug - needs a simple expression
			time       = (tmp1 + tmp2);
			hours      = time / 3600;
			sec        = time % 3600;
			min        = sec / 60;
			sec        %= 60;
			tot_xf     += sys_xf[sys];
			tot_by_rec += by_rec[sys];
			tot_by_xmt += by_xmt[sys];
			tot_time   += time;
#
# protect myself against mathematical crime (divide by zero)
			if (sec_rec[sys] == 0)
				sec_rec[sys] = 1;
			if (sec_xmt[sys] == 0)
				sec_xmt[sys] = 1;
#
# print a pretty system report (god what an awful printf format...)
			printf("%-8s%8d%11d%11d%4d:%.2d:%.2d%8d%9d%9d\n", \
sysname[sys], sys_xf[sys], by_rec[sys], by_xmt[sys], hours, min, sec, \
((by_rec[sys] + by_xmt[sys]) / sys_xf[sys]), \
(by_rec[sys]  / sec_rec[sys]), \
(by_xmt[sys]  / sec_xmt[sys]));
#
# make certain we will not see this system again... (selection sort)
			sys_xf[sys] = 0;
		}
	}
#
# calculate time split for total time (and print totals [*shudder*])
	hours = tot_time / 3600;
	sec = tot_time % 3600;
	min = sec / 60;
	sec %= 60;
	printf("\n%-8s%8d%11d%11d%4d:%.2d:%.2d\n", \
	"TOTALS", tot_xf, tot_by_rec, tot_by_xmt, hours, min, sec);
}

--------------end------------------end------------------end----------------

    This works very well for me and I hope you find it useful.


						John


---
John Gayman, WA3WBU              |           UUCP: uunet!wa3wbu!john
1869 Valley Rd.                  |           ARPA: john@wa3wbu.uu.net 
Marysville, PA 17053             |           Packet: WA3WBU @ AK3P 

root@conexch.UUCP (Larry Dighera) (11/24/88)

In article <269@ispi.UUCP> jbayer@ispi.UUCP (Jonathan Bayer) writes:
>Having just upgraded from Version 2 (?) uucp to HDB uucp, I was 
>disappointed to find that the program uusub was not available.  I am 
>wondering if anyone has a public-domain version which could be adapted
>to HDB?  I use it to moniter the amount of data transmitted during certain
>time periods, and as far as I can tell (I have RTFM) HDB does not supply
>that information.  The HDB uulog program does not provide a summary, but a
>full dump.  The uustat program  does not provide this info either.

You will find that uusub is dependent on /usr/spool/uucp/Syslog,
/usr/spool/uucp/L_sub, and /usr/spool/uucp/R_sub.  HDB UUCP does not 
maintain these files.  
 
It looks like SCO has found it to be too much trouble to port uusub to
work with HDB UUCP.  Perhaps it will reappear in a future SCO release?

In the mean time, you will find that uulog is a shell script, so you can
modify it to perform the functionality of uusub.  
 
Larry Dighera


-- 
USPS: The Consultants' Exchange, PO Box 12100, Santa Ana, CA  92712
TELE: (714) 842-6348: BBS (N81); (714) 842-5851: Xenix guest account (E71)
UUCP: conexch Any ACU 2400 17148425851 ogin:-""-ogin:-""-ogin: nuucp
UUCP: ...!uunet!turnkey!conexch!root || ...!trwrb!ucla-an!conexch!root