[news.admin] Script to display useful information about your usenet neighbors

news@conexch.UUCP (USENET Administrator) (05/02/89)

Here is a copy of the script that I use to check on the activity of
my usenet neighbors.  All usenet administrators are hereby granted permission
to copy, use, and modify it as they wish.  Please send me any improvements
you may make.

---
:
#	nstat
#	This script will display the count of articles received via each
#	news neighbor's site and the percentage of duplicates received.
#
#	Copyright Dighera Data Services Thu Mar  2 19:38:41 PST 1989
#
#	Written for Xenix 
#

LOG=/usenet/usenet/lib/log	# the usenet logfile; normally /usr/lib/news/log
#LASTDATE=`ls -l $LOG.old.Z | awk '{print $6, $7, $8}'`
LASTDATE="`head -1 $LOG | cut -c1-12`"	# This will work on all systems
SITE1=ccicpg	#Put your usenet neighbors here
SITE2=zardoz	#Put your usenet neighbors here
SITE3=stanton	#Put your usenet neighbors here
export LOG SITE1 SITE2 LASTDATE

echo "\n\nPlease standby while logfile is being scanned ..."
echo "\n\n\t\tU S E N E T    S T A T U S    I N F O R M A T I O N\n"
echo "\tFrom: $LASTDATE\t\tTo: `date`\n\n\n"
#awk -F"	" 'BEGIN {tr = 0; td = 0; tt = 0; zr = 0; zd = 0; zt = 0; sr = 0; sd = 0; st = 0}
awk -F"	" 'BEGIN {tr=0;td=0;tt=0;zr=0;zd=0;zt=0;sr=0;sd=0;st=0}
$2 == "'$SITE1'" {if (substr($3,1,5) == "recei") tr++}
$2 == "'$SITE1'" {if (substr($3,1,3) == "Dup") td++}
$2 == "'$SITE2'" {if (substr($3,1,5) == "recei") zr++}
$2 == "'$SITE2'" {if (substr($3,1,3) == "Dup") zd++}
$2 == "'$SITE3'" {if (substr($3,1,5) == "recei") sr++}
$2 == "'$SITE3'" {if (substr($3,1,3) == "Dup") sd++}
END {tt=tr+td; zt=zr+zd; zt=zr+zd; st=sr+sd}
END {print "CCICPG: \t\t\t\tSTANTON:\n\tArticles Posted: \t", tr, "\t\tArticles Posted: \t", sr, "\n\tDuplicates Rejected: \t", td, "\t\tDuplicates Rejected: \t", sd}
END {printf("Total Articles Received: \t %d \tTotal Articles Received: \t %d\nPercentage of Duplicates: \t ", tt, st); if (td == 0) printf("0%"); else printf("%-3.1f\%", td/tt*100); printf("\tPercentage of Duplicates: \t ");if (sd == 0) print "0%\n"; else printf("%-3.1f\%\n", sd/tt*100)}
END {print "\n\nZARDOZ: \n\tArticles Posted: \t", zr, "\n\tDuplicates Rejected: \t", zd}
END {printf("Total Articles Received: \t %d\nPercentage of Duplicates: \t ", zt); if (zd == 0) print "0%\n"; else printf("%-3.1f\%\n", (zd/zt)*100)}' $LOG

df -v -i /dev/unet | awk 'NR > 1 {print "\n\t\t", $4, "free blocks  ", $5, "blocks used\n\t\t", $7, "free Inodes  ", $8, "inodes used"}'
---

Larry Dighera

-- 
USMAIL: The Consultants' Exchange, PO Box 12100, Santa Ana, CA  92712
(714) 842-6348: IBM-PC BBS (N81); (714) 842-5851: Xenix guest account (E71)
UUCP: ...!ucbvax!ucivax!icnvax!conexch!news || ...!trwb!ucla-an!conexch!news
UUCP: conexch Any ACU 2400 17148425851 ogin:-""-ogin:-""-ogin: nuucp