Article View: news.software.nntp
Article #14313Re: Simple way to get a list of inbound nntp connections to INN?
From: Joe Greco
Date: Wed, 22 Jan 1997 00:00
Date: Wed, 22 Jan 1997 00:00
103 lines
2699 bytes
2699 bytes
In article <82buaioyu4.fsf@eagle.eecs.umich.edu>,
Michael Hucka <hucka@eecs.umich.edu> wrote:
>Is there a simple way to get a list of which sites are currently connected to
>innd? What I've been doing so far is
>
> lsof | grep innd | grep nntp
>
>since I haven't found an obvious command to do it. But this is like using a
>golden brick to swat a fly.
>
>Seems like `ctlinnd' should have an option similar to "feedinfo", but in the
>reverse direction; i.e., listing inbound connections.
Try:
#! /bin/sh
PATH=${PATH}:/usr/local/news/bin:/usr/local/bin; export PATH
uptime
echo ""
ctlinnd mode
echo ""
newsdelay
echo ""
echo 'Server connections:'
ctlinnd -t60 name '' 2>&1 \
| egrep -v ':proc:|:file:|:file$|^remconn:|^control:|^localconn:' \
| sed -e 's/:[0-9]*$//' \
| sort \
| uniq -c \
| sed -e '/^[ ]*$/d' \
| awk '{print length($0), $0}' \
| sort -n \
| sed 's/^[0-9][0-9]* *//' \
| awk '
BEGIN {
linelen = 0;
}
{
len = length($0);
if (len >= 80) {
end = "";
}
else if (len >= 72) {
end = "\t\t\t";
len += 16 + (8 - len % 8);
}
else if (len >= 64) {
end = "\t";
len += (8 - len % 8);
}
else if (len >= 56) {
end = "\t\t";
len += 8 + (8 - len % 8);
}
else if (len >= 48) {
end = "\t\t\t";
len += 16 + (8 - len % 8);
}
else if (len >= 40) {
end = "\t";
len += (8 - len % 8);
}
else if (len >= 32) {
end = "\t";
len += (8 - len % 8);
}
else if (len >= 24) {
end = "\t\t";
len += 8 + (8 - len % 8);
}
else if (len >= 16) {
end = "\t";
len += (8 - len % 8);
}
else if (len >= 8) {
end = "\t\t";
len += 8 + (8 - len % 8);
}
else {
end = "\t\t\t";
len += 16 + (8 - len % 8);
}
if (len + linelen > 80) {
printf("\n");
linelen = len;
}
else {
linelen += len;
}
printf("%s%s", $0, end);
}
END {
if (end != "\n") {
printf("\n");
}
printf("\n");
}'
... JG
Technical Details
Message-ID:
<5c52p8$g0c@earth.alpha.net>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-mailReferences:
<82buaioyu4.fsf@eagle.eecs.umich.edu>Show Full Headers
Complete Article Headers
Message-ID: <5c52p8$g0c@earth.alpha.net> Subject: Re: Simple way to get a list of inbound nntp connections to INN? Date: Wed, 22 Jan 1997 00:00:00 +0000 From: jgreco@ns.sol.net (Joe Greco) References: <82buaioyu4.fsf@eagle.eecs.umich.edu> 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: 211500254 Distribution: inet Sender: joegreco@earth.execpc.com Organization: sol.net Network Services - Milwaukee, WI Newsgroups: news.software.nntp