🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: news.software.nntp
2 messages
2 total messages Started by Dominique Berube Wed, 03 Apr 1996 00:00
How can I log the groups my users are reading on my Usenet server...
#6239
Author: Dominique Berube
Date: Wed, 03 Apr 1996 00:00
13 lines
1046 bytes
Hi,

     I'm looking to accumulate statistics about the groups my users
are reading on my server.  I'm running INN 1.4 and I find nothing in
the documentation and the FAQ to do that.  Does anoyone can help me
to configure my server to log the groups consultated by my users?

You can send me the information to Dominique.Berube@sit.ulaval.ca

Dominique :-)


Re: How can I log the groups my users are reading on my Usenet server...
#6250
Author: Jack Bryans
Date: Wed, 03 Apr 1996 00:00
65 lines
2391 bytes
In article <4jsf3h$oec@athena.ulaval.ca> Dominique Berube
<Dominique.Berube@sit.ulaval.ca> writes:

>      I'm looking to accumulate statistics about the groups my users
> are reading on my server.

The following perl script is driven by normal mail delivery using the alias
for usenet.  It accumulates news group readership and maintains a frequency
sorted list in the groups.read file among your news logs.

If news is read via nfs on your system, you're SOL.

#!/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}; }

The path to perl and the news log path at the top, as well we the way you
call mail towards the bottom are the areas that may need change for your
system.

Suppose the perl script is /usr/local/etc/cumegrps.pl.  Just add
|"/usr/local/etc/cumegrps.pl"
to your usenet alias and, as user news, touch the groups.read file.

If your sendmail is using smrsh, you'll need to put it in /usr/adm/sm.bin,
or however you've got your smrsh config'd.

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