SUMMARY - Tracking UUCP stats

From: Alek O. Komarnitsky (alek@spatial.com)
Date: Mon Sep 16 1991 - 18:34:53 CDT


---- Here's the original question ---------------------------------------------

... Now I need to track uucp usage (# messages, #bytes, duration of calls).
I had some scripts that parsed some log scripts under Pre-SunOS4.1, but they
aren't much help with HDB UUCP. It looks like xferstats under .Admin and .Old
is where some data is kept, but I'm not sure this is the best data to parse
for what I'm after.

I'm sure someone else has done this - can someone help? BTW, no Big Brother
intentions here - I just need some numbers to help justify/track modem usage.

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

The Replies:

mpeppler@itf0.itf.ch (Michael Peppler) mentioned some perl scripts
diekema@jdbbs.mi.org (Jon Diekema) sent a C program
pixels!wmg@att.att.com suggested uutraf available via FTP
ico.isc.com!jim@saylor.saylor.mn.org (Jim Anderson) send a shar copy of uutraf

I used the uutraf program, which works fine. The one problem is that Sun
does not appear (?) to keep old xferstats around (they kept a revolving year's
around with Pre-HDB UUCP), nor did I see a "switch" to turn this on. So I
wrote the following script in /etc/uucp/uudemon.monthly called by cron:

#!/bin/csh -f
# alek (9/91) wrote this to run once/month to as to log monthly HDB UUCP stats
# Note that change was made in uudemon.cleanup, so xferstats from .Admin
# are *appended* (rather than mv'ed) to .Old/.xferstats
# This should be called from cron on the first day of each month
# since I'm not sure how one refers to the last day in cron
# Note the ugly code below to go "back" a month.

set day = `date +%d`
set tempvar = $1 #why do we have to do this!
if (( $day != 1 ) && ( "$tempvar" != "-override" )) then
   echo "This is not the first day of the month"
   echo "use uudemon.monthly -override to force it to run"
   exit 2
endif

set statsdir = /usr/spool/uucp/.Old/monthly
set year = `date +%y` # Yep, another program that will break in the year 2000
set month = `date +%m`
@ month --
if ( $month == 0 ) then
   set month = 12
   @ year--
endif
if ( $month < 10 ) set month = "0"$month
set yearmonth="${year}${month}"

cd $statsdir
if ( -e $yearmonth ) then
   echo "$statsdir/$yearmonth allready exists - must be removed first"
   echo "exiting"
   exit 2
endif
mv ../xferstats $yearmonth
echo "uudemon.monthly run for $yearmonth" | /usr/ucb/mail uucp
exit

Note the comment about modifying uudemon.cleanup. Below is some sample output
from Jim that looks very nice for my needs:

Remote -----------K-Bytes----------- ----Hours---- --Avg CPS-- --Files--
 Host Recv Sent Total Recv Sent Recv Sent Recv Sent
------ --------- --------- --------- ------ ------ ----- ----- ---- ----
macgate 0.6 10146.0 10146.6 0.0 2.5 81 1134 2 78
questar 1.4 9303.4 9304.8 0.0 3.4 535 759 2 84
edgar 4946.0 2.3 4948.3 1.1 0.0 1239 1781 32 4
hornet 0.0 3834.0 3834.0 0.0 1.3 0 834 0 38
aob 12.3 0.0 12.3 0.0 0.0 106 0 3 0
tcnet 0.0 1.0 1.0 0.0 0.0 0 1830 0 2

                   -------------SUMMARY-------------
                   Total active uucp sites: 6
                   Total files recv: 39
                   Total files sent: 206
                   Total files: 245
                   Total hours recv: 1.1
                   Total hours sent: 7.2
                   Total hours: 8.3
                   Total K-bytes recv: 4,960
                   Total K-bytes sent: 23,287
                   Total K-bytes: 28,247

Thanx again for everyone's help,

Alek Komarnitsky 303-449-0649
Software Tools Manager, Spatial Technology, Inc. 2425 55th Street, Bldg A
alek@spatial.com Boulder, CO 80301-5704

P.S. Summary to follow soon about turning on/off a demo machine.
     Yep, /etc/nologin is *part* of the answer.



This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:19 CDT