🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Scott C. Walker Tue, 04 Jun 1996 00:00
News usage programs
#8243
Author: Scott C. Walker
Date: Tue, 04 Jun 1996 00:00
12 lines
916 bytes
Sorry if this has been asked before...

I'm looking for a program that will show me who is using my server the
most, what groups are being accessed the most, etc.

I've looked on Dave Barr's page already, but didn't see anything.

Thanks  for your time,
   Scott

Re: News usage programs
#8308
Author: Jack Bryans
Date: Thu, 06 Jun 1996 00:00
59 lines
2084 bytes
In article <31B490FB.7DE1@tornado.es.dupont.com> "Scott C. Walker"
<walkersc@tornado.es.dupont.com> writes:

> I'm looking for a program that will show me who is using my server the
> most, what groups are being accessed the most, etc.

The following perl script, cumegrps.pl, maintains a list of groups read via
nntp, sorted by frequency.

To use, edit the path to perl and to the newslogs at the top, and the path
to mail toward the bottom, and install as executable in say, /usr/local/etc.
Then add |"/usr/local/etc/cumegrps.pl" to your usenet alias.

You may have to pre-create /var/log/news/groups.read, and/or change its
owner or group, or chmod 0666 it, depending on how your mail works.

#!/usr/local/bin/perl

$cume = "/var/log/news/groups.read";

while(<>) {
    next until /^Subject:/;
    last if /Daily Usenet report/;
    seek(STDIN,0,2);
    exit;}

exit if eof;

while(<>) { last if /\(by newsgroup\)/; }

exit if eof;

if (open(CUME,"$cume")) {
    while(<CUME>) {
	($grp,$cnt) = split;
	$stats{$grp} = $cnt;}}

while(<>) {
    last if /^\s$/;
    ($grp,$cnt) = split;
    $stats{$grp} += $cnt;}

open(CUME,"> $cume")  ||
    exec( "/usr/sbin/Mail -s \"failed to create $cume\" usenet < /dev/null" );

foreach $key (sort by_value keys %stats) { write(CUME); }
close(CUME);

format CUME =
@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< @######
$key,$stats{$key}
..

sub by_value { $stats{$b} <=> $stats{$a}; }

Jack

Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads