🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #16895

Re: Status of nnrpd

#16895
From: bill davidsen
Date: Thu, 10 Apr 1997 00:00
46 lines
2146 bytes
In article <334ACC1E.3F54@paynjc.portsmouth.uk.ibm.com>,
John Payne  <john@paynjc.portsmouth.uk.ibm.com> wrote:

| And along the same kind of lines (if your mind works the same as mine),
| is there any way of getting a snapshot of the status of nnrpd, kind of
| like the number of nnrpd processes, grouped per site, or age, etc...
| especially kewl if it would graph the results as well :-)

Please flame me by mail for posting this half screen of source
code...
================================================================
#!/usr/local/bin/perl

# open the process file
open(NETSTAT, "netstat -f inet|") || die "Can't start netstat
process";

# process the output
while (<NETSTAT>) {
  if (m/\.nntp[ \t]/) {
    # pick up the node name field, drop the socket number
    split;
    $node = @_[4];
    $node =~ s/\.[^.]*$//;
    $count{$node}++;
  }
}

# output the counts
foreach $node (sort keys %count) {
  printf("%5d %s\n", @count{$node}, $node);
}
================================================================

There's a fair chance that this is in some way AIX dependent and you
will have to tune the offsets to match your netstat output.

Beware, this has been through drag and drop, if something isn't
quite right, it would astonish me.
--
   -bill davidsen (davidsen@prodigy.com) Prodigy Internet Server Support
"The secret to procrastination is to put things off until the
 last possible moment - but no longer"  -me

Technical Details
Message-ID: <5ihgi6$l3g@newssvr04-int.news.prodigy.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
References: <3349c234.4449444@news.deltanet.com> <334ACC1E.3F54@paynjc.portsmouth.uk.ibm.com>

Show Full Headers
Complete Article Headers
Message-ID: <5ihgi6$l3g@newssvr04-int.news.prodigy.com>
Subject: Re: Status of nnrpd
Date: Thu, 10 Apr 1997 00:00:00 +0000
From: davidsen@prodigy.com (bill davidsen)
References: <3349c234.4449444@news.deltanet.com> <334ACC1E.3F54@paynjc.portsmouth.uk.ibm.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.software.nntp.mbox.zip!not-for-mail
X-Deja-AN: 232007104
Distribution: inet
Organization: Prodigy Services (1-800-PRODIGY)
Newsgroups: news.software.nntp
Originator: davidsen@darkstar.prodigy.com