## @(#) newsinfo.awk falcon@cats.ucsc.edu (jon r. luini) 7/4/92
## Modified by Robert Elz to understand more reports.
## Modified by Rich $alz for consistent formatting.
## Modified by Chris Schmidt to sort output.
invalid =
"~~~~~~~~~~~~~~~~~~~~~~~~"
ctlinnd
["a"] =
"addhist";
ctlinnd
["u"] =
"changegroup";
ctlinnd
["d"] =
"checkfile";
ctlinnd
["g"] =
"flushlogs";
ctlinnd
["k"] =
"newgroup";
ctlinnd
["v"] =
"readers";
ctlinnd
["n"] =
"renumber";
ctlinnd
["z"] =
"reserve";
ctlinnd
["p"] =
"rmgroup";
ctlinnd
["q"] =
"shutdown";
ctlinnd
["r"] =
"throttle";
$
5 ==
"last" && $
6 ==
"message" && $
7 ==
"repeated" {
nnrp_articles
[host
] += $
9;
nnrp_groups
[host
] += $
11;
nnrp_rejected
[host
] += $
11;
nnrp_times_user
[host
] += $
9;
nnrp_times_sys
[host
] += $
11;
nnrp_times_elapsed
[host
] += $
13;
nnrp_group_request
[$
8]++;
## Skip; handled in "posts" above.
if ($
7 ==
"unrecognized") {
if ($
7 ==
"no_permission") {
if ($
6 ==
"gethostbyaddr:") {
if ($
7 ==
"cant" && $
8 ==
"gethostbyaddr") {
## Skip; handled in "gethostbyaddr:" above.
if ( $
6 ~
/^
[a
-zA
-Z
]:.
*/ || $
6 ~
/^
[dgs
]$
/ ) {
## Note that the last parameter in $6 may be continued in $7 etc
if (ctlinnd
[ctl
[1]] ==
"") {
## Unknown; update this script!
## Newgroup. Process it here so we can get the creator.
ctlinnd_newgroups
[ctl
[2]] = ctl
[4];
## Rmgroup. Process it here for symmetry.
ctlinnd_rmgroups
[ctl
[2]] =
1;
n =
split($
6, path
, ":");
## Account for the fact that innd says "local connected ##"
## and then "localhost:## closed"
innd_seconds
[host
] += $
9;
innd_accepted
[host
] += $
11;
innd_refused
[host
] += $
13;
innd_rejected
[host
] += $
15;
if (cp_innd_chkp
[host
] ==
1) {
if ($
7 ==
"checkpoint") {
cp_innd_seconds
[host
] = $
9;
cp_innd_accepted
[host
] = $
11;
cp_innd_refused
[host
] = $
13;
cp_innd_rejected
[host
] = $
15;
if (cp_innd_chkp
[host
] ==
0) {
## Skip; handled by "opened/spawned" below.
if ($
7 ==
"opened" || $
7 ==
"spawned") {
n =
split($
8, blarg
, ":");
innd_feed
[host
] = blarg
[n
];
if ($
7 ==
"change_group") {
## Unfinished checkpoints from before; something crashed.
for (s in cp_innd_chkp
) {
if (cp_innd_chkp
[s
] ==
0)
innd_seconds
[s
] += cp_innd_seconds
[s
];
innd_accepted
[s
] += cp_innd_accepted
[s
];
innd_refused
[s
] += cp_innd_refused
[s
];
innd_rejected
[s
] += cp_innd_rejected
[s
];
if ($
7 ==
"ihave_from_me") {
if ($
7 ==
"bad_messageid") {
if ($
7 ==
"bad_sendme") {
if ($
7 ==
"blocked" && $
8 ==
"sleeping") {
if ($
7 ==
"exit" && $
8 ==
"0") {
## Program or process finished normally; don't care.
if ($
7 ==
"wakeup" || ($
7 ==
"cant" && ($
8 ==
"write" || $
8 ==
"read"))) {
## Skip; handled by "blocked/sleeping" above.
if ($
7 ==
"inactive" || $
7 ==
"descriptors" \
|| $
7 ==
"outgoing" || $
7 ==
"running" \
|| $
7 ==
"lcsetup" || $
7 ==
"ccsetup" \
|| $
7 ==
"rcsetup" || $
7 ==
"readclose" \
## Since times lines are always followed by stats lines, we
## only do the batcher_site[host]++ and batcher=1 once
batcher_times_user
[host
] += $
10;
batcher_times_sys
[host
] += $
12;
batcher_times_elapsed
[host
] += $
14;
batcher_num
[host
] += $
10;
batcher_articles
[host
] += $
12;
batcher_bytes
[host
] += $
14;
n =
split($
6, path
, ":");
if ($
7 ==
"ihave" && $
8 ==
"failed") {
## ihave failed occurs when the server rejects an article,
## and requests it to be resent at the ihave stage - this
## always indicates a server problem (all it has of the article
## is its message-id) most commonly "out of space" - in that
## case we don't really want to count this as an offered
## article, so remember this happened so we can reduce the
innxmit_ihfail
[host
] =
1;
if ($
9 ==
"436" && $
11 ==
"NNTP" && $
13 ==
"out" && $
15 ~
/space
/) {
## Since stats lines are always followed by times lines we
## only do the innxmit_site[host]++ and innxmit=1 once
innxmit_offered
[host
] += $
9 - innxmit_ihfail
[host
];
innxmit_accepted
[host
] += $
11;
innxmit_rejected
[host
] += $
13;
innxmit_failed
[host
] += $
15;
innxmit_ihfail
[host
] =
0;
innxmit_times_user
[host
] += $
9;
innxmit_times_sys
[host
] += $
11;
innxmit_times_elapsed
[host
] += $
13;
for (i =
10; i
< NF; i
++)
innxmit_reQ_host
[host
]++;
if ($
7 ==
"connect" && $
9 ==
"400" \
&& (($
10 ==
"No" && $
11 ==
"space") \
|| ($
11 ==
"NNTP" && $
13 ==
"out" && $
15 ~
/space
/))) {
## There is no startup marked for this.
if ($
7 ==
"connect" && $
9 ==
"400" && $
10 ==
"loadav") {
## There is no startup marked for this.
if ($
7 ==
"connect" && $
9 ==
"400" && $
0 ~
/[Ee
][Xx
][Pp
][Ii
][Rr
]/) {
## There is no startup marked for this.
if ($
7 ==
"connect" && $
9 ==
"400") {
## There is no startup marked for this.
innxmit_crefused
[host
]++;
if ($
7 ==
"connect" && $
8 ==
"failed") {
## There is no startup marked for this.
innxmit_cfail_host
[host
]++;
#for (i = 10; i < NF; i++)
#innxmit_cfail_reason[r]++;
if ($
7 ==
"authenticate" && $
8 ==
"failed") {
## There is no startup marked for this.
innxmit_afail_host
[host
]++;
#for (i = 10; i < NF; i++)
#innxmit_afail_reason[r]++;
if ($
7 ==
"connection") {
if ($
8 ==
"Unwanted" && $
9 ==
"newsgroup") {
if ($
8 ==
"Unwanted" && $
9 ==
"distribution") {
if ($
8 ==
"Bad" && $
9 ==
"\"Date\"") {
n =
split($
6, path
, ":");
## There is no startup marked for this.
if ($
10 ==
"Broken" && $
11 ==
"pipe") {
## There is no startup marked for this.
if ($
7 ==
"greeted" && $
10 ==
"400" \
&& (($
11 ==
"No" && $
12 ==
"space") \
|| ($
12 ==
"NNTP" && $
14 ==
"out" && $
16 ~
/space
/))) {
## There is no startup marked for this.
nntplink_nospace
[host
]++;
if ($
7 ==
"greeted" && $
10 ==
"400" && $
11 ==
"loadav") {
## There is no startup marked for this.
if ($
7 ==
"greeted" && $
10 ==
"400" && $
0 ~
/[Ee
][Xx
][Pp
][Ii
][Rr
]/) {
## There is no startup marked for this.
if ($
7 ==
"greeted" && $
10 ==
"400") {
## Some other failure, or innd throttle for some local reason.
## There is no startup marked for this.
## There is no startup marked for this.
nntplink_sockerr
[host
]++;
if ($
7 ==
"connection" && $
8 ==
"timed" && $
9 ==
"out") {
## There is no startup marked for this. Fake reason.
if ($
7 ==
"sent" && $
8 ==
"authinfo" && $
10 ==
"exiting") {
## There is no startup marked for this.
if ($
7 ==
"sent" && $
8 ==
"IHAVE") {
## An "ihave failure": site rejected the article after the
## IHAVE command; most likely it was out of space. Don't
## count this as an offered article, so remember it. Since
## nntplink keeps trying to send we could get many such
## failures in a single connection. For counting purposes
## we pretend that there were several separate connections.
if ($
11 ==
"436" && $
13 ==
"NNTP" && $
15 ==
"out" && $
17 ~
/space
/) {
nntplink_fake_connects
[host
]++;
nntplink_nospace
[host
]++;
## Since stats lines are always followed by xmit lines, we
## only do the nntplink_site[host]++ and nntplink=1 once
nntplink_offered
[host
] += $
8 - nntplink_ihfail
[host
];
nntplink_accepted
[host
] += $
10;
nntplink_rejected
[host
] += $
12;
nntplink_failed
[host
] += $
14;
nntplink_ihfail
[host
] =
0;
if (nntplink_fake_connects
[host
]) {
nntplink_site
[host
] += nntplink_fake_connects
[host
];
nntplink_fake_connects
[host
] =
0;
nntplink_times_user
[host
] += $
9;
nntplink_times_sys
[host
] += $
11;
nntplink_times_elapsed
[host
] += $
13;
## We can compute this if we need it, but there isn't
## space in the output table for it
#nntplink_offer_min[host] += $9;
#nntplink_accept_min[host] += $11;
## 503 is the code for timeouts.
if ($
11 ==
"503" || $
12 ==
"Timeout") {
nntplink_timeout
[host
]++;
n =
split($
6, path
, ":");
nntpd_seconds
[host
] += $
9 + $
11;
nntpd_elapsed
[host
] += $
13;
if (nntpd_connect
[host
] ==
0)
if ($
7 ==
"ihave_stats") {
nntpd_accepted
[host
] += $
9;
nntpd_refused
[host
] += $
11;
nntpd_rejected
[host
] += $
13;
if ($
7 ==
"no" && $
8 ==
"space") {
if (nntpd_connect
[host
] ==
0)
if ($
6 ==
"no" && $
7 ==
"space")
## Rest is likely to be reader stuff; skip for now.
if ($
6 ==
"Started" && $
7 ==
"mthreads") {
if ($
6 ==
"Processed" && $
9 ==
"added" && $
12 ==
"expired") {
if ($
6 ==
"Turned" && $
8 ==
"groups" && $
9 ==
"on.") {
mthreads_turned_on
+= $
7;
if ($
6 ==
"Turned" && $
8 ==
"groups" && $
9 ==
"off.") {
mthreads_turned_off
+= $
7;
printf("Unknown entries from news log file:\n");
## NOTE: the following are collected but not used right now:
## INND control statistics.
printf("Control commands to INND\t(%d total)\n\n", ctlinnd_seen
);
for (m in ctlinnd_type
) {
printf("\t%13s %4d", ctlinnd
[m
], ctlinnd_type
[m
]);
printf("Newsgroups created:\n");
for (m in ctlinnd_newgroups
)
printf("\t%-30.30s by %s\n", m
, ctlinnd_newgroups
[m
]);
printf("Newsgroups removed:\n");
for (m in ctlinnd_rmgroups
)
## INND exchange statistics.
printf("Articles received by server\n");
printf("System Connects Offered Took Refuse Rejct Accpt Elapsed\n");
for (sortindex in innd_connect
)
if (innd_connect
[sortindex
] >=
0 && sortindex
< s
)
ninnd_connect
+= innd_connect
[s
];
ninnd_accept
+= innd_accepted
[s
];
ninnd_refuse
+= innd_refused
[s
];
ninnd_reject
+= innd_rejected
[s
];
ninnd_ela
+= innd_seconds
[s
];
offered = innd_accepted
[s
] + innd_refused
[s
] + innd_rejected
[s
];
ninnd_offered
+= offered
;
percent_accpt =
(innd_accepted
[s
] * 100) / offered
;
e_hours = innd_seconds
[s
] / 3600;
e_sec = innd_seconds
[s
] %
3600;
printf("%-20.20s %5d %6d %6d %6d %5d %3d%% %3d:%02d:%02d\n", \
innd_accepted
[s
] + innd_refused
[s
] + innd_rejected
[s
], \
innd_accepted
[s
], innd_refused
[s
], innd_rejected
[s
], \
percent_accpt
, e_hours
, e_min
, e_sec
);
e_hours = ninnd_ela
/ 3600;
e_sec = ninnd_ela %
3600;
they_offered = ninnd_offered
;
percent_accpt =
(ninnd_accept
* 100.0)/ (they_offered
+ 0.1);
printf("\n%-20s %5d %6d %6d %6d %5d %3d%% %3d:%02d:%02d\n\n", \
"TOTALS", ninnd_connect
, ninnd_offered
, ninnd_accept
, \
ninnd_refuse
, ninnd_reject
, percent_accpt
, e_hours
, e_min
, \
## Miscellaneous innd statistics.
printf("Bad Message-ID's offered\n");
for (sortindex in innd_bad_msgid
)
if (innd_bad_msgid
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, innd_bad_msgid
[s
]);
printf("Bad ihave control messages received\n");
for (sortindex in innd_bad_ihave
)
if (innd_bad_ihave
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, innd_bad_ihave
[s
]);
printf("Ignored sendme control messages received\n");
for (sortindex in innd_bad_sendme
)
if (innd_bad_sendme
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, innd_bad_sendme
[s
]);
printf("Blocked server feeds\n");
for (sortindex in innd_blocked
)
if (innd_blocked
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, innd_blocked
[s
]);
printf("Articles received by NNTPD\n");
printf("System Connects NSpc Fail Offered Took Refuse Rejct Accpt Elapsed\n");
for (sortindex in nntpd_connect
)
if (nntpd_connect
[sortindex
] >=
0 && sortindex
< s
)
nnntpd_connect
+= nntpd_connect
[s
];
nnntpd_nospace
+= nntpd_nospace
[s
];
nnntpd_accept
+= nntpd_accepted
[s
];
nnntpd_refuse
+= nntpd_refused
[s
];
nnntpd_reject
+= nntpd_rejected
[s
];
nnntpd_ela
+= nntpd_elapsed
[s
];
nnntpd_done
+= nntpd_done
[s
];
offered = nntpd_accepted
[s
] + nntpd_refused
[s
] + nntpd_rejected
[s
];
nnntpd_offered
+= offered
;
percent_accpt =
(nntpd_accepted
[s
] * 100) / offered
;
e_hours = nntpd_elapsed
[s
] / 3600;
e_sec = nntpd_elapsed
[s
] %
3600;
printf("%-20.20s %5d %4d %4d %6d %6d %6d %5d %3d%% %3d:%02d:%02d\n", \
s
, nntpd_connect
[s
], nntpd_nospace
[s
], \
nntpd_connect
[s
] - nntpd_done
[s
], \
nntpd_accepted
[s
] + nntpd_refused
[s
] + nntpd_rejected
[s
], \
nntpd_accepted
[s
], nntpd_refused
[s
], nntpd_rejected
[s
], \
percent_accpt
, e_hours
, e_min
, e_sec
);
e_hours = nnntpd_ela
/ 3600;
e_sec = nnntpd_ela %
3600;
they_offered = nnntpd_offered
;
percent_accpt =
(nnntpd_accept
* 100.0)/ (they_offered
+ 0.1);
printf("\n%-20s %5d %4d %4d %6d %6d %6d %5d %3d%% %3d:%02d:%02d\n\n", \
"TOTALS", nnntpd_connect
, nnntpd_nospace
, \
nnntpd_connect
- nnntpd_done
, \
nnntpd_offered
, nnntpd_accept
, nnntpd_refuse
, nnntpd_reject
, \
percent_accpt
, e_hours
, e_min
, e_sec
);
printf("Articles sent by innxmit\n");
printf("System Offrd Took Toss Fail Pct Elapsed CPU Pct\n");
for (sortindex in innxmit_site
)
if (innxmit_offered
[sortindex
] >=
0 && sortindex
< s
)
we_offered = innxmit_offered
[s
];
they_take =
(innxmit_accepted
[s
] * 100.0) / we_offered
;
e_hours = innxmit_times_elapsed
[s
] / 3600;
e_sec = innxmit_times_elapsed
[s
] %
3600;
c_hours =
(innxmit_times_user
[s
] + innxmit_times_sys
[host
]) / 3600;
c_sec =
(innxmit_times_user
[s
] + innxmit_times_sys
[s
]) %
3600;
elapsed = innxmit_times_elapsed
[s
];
pct =
((innxmit_times_user
[s
] + innxmit_times_sys
[s
]) * 100.0) / elapsed
;
printf("%-20.20s %6d %6d %6d %5d %3d%% %3d:%02d:%02d %3d:%02d:%02d %3d%%\n", \
s
, innxmit_offered
[s
], innxmit_accepted
[s
], \
innxmit_rejected
[s
], innxmit_failed
[s
], they_take
, \
e_hours
, e_min
, e_sec
, c_hours
, c_min
, c_sec
, pct
);
ixmt
+= innxmit_offered
[s
];
ixmt_accept
+= innxmit_accepted
[s
];
ixmt_reject
+= innxmit_rejected
[s
];
ixmt_failed
+= innxmit_failed
[s
];
ixmt_ela
+= innxmit_times_elapsed
[s
];
ixmt_cpu
+= innxmit_times_user
[s
] + innxmit_times_sys
[s
];
they_take =
(ixmt_accept
* 100) / we_offered
;
e_hours = ixmt_ela
/ 3600;
c_hours = ixmt_cpu
/ 3600;
pct =
(ixmt_cpu
* 100.0) / ixmt_ela
;
printf("\n%-20.20s %6d %6d %6d %5d %3d%% %3d:%02d:%02d %3d:%02d:%02d %3d%%\n\n", \
"TOTALS", ixmt
, ixmt_accept
, ixmt_reject
, ixmt_failed
, \
they_take
, e_hours
, e_min
, e_sec
, c_hours
, c_min
, c_sec
, pct
);
printf("Transmission Connection Attempts ------errors-------------------\n");
printf("System Conn Ok Auth Load Space Expire Connct Other Pct\n");
for (sortindex in innxmit_site
)
if (innxmit_site
[sortindex
] >=
0 && sortindex
< s
)
errs = innxmit_afail_host
[s
] + innxmit_hiload
[s
] + \
innxmit_nospace
[s
] + innxmit_cfail_host
[s
] + \
innxmit_expire
[s
] + innxmit_crefused
[s
];
ok =
(innxmit_site
[s
] - errs
);
printf("%-20.20s %4d %4d %4d %4d %5d %5d %5d %5d %3d%%\n", \
s
, innxmit_site
[s
], ok
, innxmit_afail_host
[s
], \
innxmit_hiload
[s
], innxmit_nospace
[s
], innxmit_expire
[s
], \
innxmit_cfail_host
[s
], innxmit_crefused
[s
], \
ict_tot
+= innxmit_site
[s
];
ict_afail
+= innxmit_afail_host
[s
];
ict_hiload
+= innxmit_hiload
[s
];
ict_nospace
+= innxmit_nospace
[s
];
ict_expire
+= innxmit_expire
[s
];
ict_crefused
+= innxmit_crefused
[s
];
ict_cfail
+= innxmit_cfail_host
[s
];
errs = ict_afail
+ ict_nospace
+ ict_hiload
+ ict_cfail
+ ict_crefused
;
printf("\n%-20.20s %4d %4d %4d %4d %5d %5d %5d %5d %3d%%\n\n", \
"TOTALS", ict_tot
, ict_ok
, ict_afail
, ict_hiload
, \
ict_nospace
, ict_expire
, ict_cfail
, ict_crefused
, \
printf("Articles sent by nntplink\n");
printf("System Offrd Took Toss Fail Pct Elapsed CPU Pct\n");
for (sortindex in nntplink_site
)
if (nntplink_offered
[sortindex
] >=
0 && sortindex
< s
)
we_offered = nntplink_offered
[s
];
they_take =
(nntplink_accepted
[s
] * 100.0) / we_offered
;
e_hours = nntplink_times_elapsed
[s
] / 3600;
e_sec = nntplink_times_elapsed
[s
] %
3600;
c_hours =
(nntplink_times_user
[s
] + nntplink_times_sys
[host
]) / 3600;
c_sec =
(nntplink_times_user
[s
] + nntplink_times_sys
[s
]) %
3600;
elapsed = nntplink_times_elapsed
[s
];
pct =
((nntplink_times_user
[s
] + nntplink_times_sys
[s
]) * 100.0) / elapsed
;
printf("%-20.20s %6d %6d %6d %5d %3d%% %3d:%02d:%02d %3d:%02d:%02d %3d%%\n", \
s
, nntplink_offered
[s
], nntplink_accepted
[s
], \
nntplink_rejected
[s
], nntplink_failed
[s
], they_take
, \
e_hours
, e_min
, e_sec
, c_hours
, c_min
, c_sec
, pct
);
nxmt
+= nntplink_offered
[s
];
nxmt_accept
+= nntplink_accepted
[s
];
nxmt_reject
+= nntplink_rejected
[s
];
nxmt_failed
+= nntplink_failed
[s
];
nxmt_ela
+= nntplink_times_elapsed
[s
];
nxmt_cpu
+= nntplink_times_user
[s
] + nntplink_times_sys
[s
];
nntplink_offered
[s
] =
-1;
they_take =
(nxmt_accept
* 100) / we_offered
;
e_hours = nxmt_ela
/ 3600;
c_hours = nxmt_cpu
/ 3600;
pct =
(nxmt_cpu
* 100.0) / nxmt_ela
;
printf("\n%-20.20s %6d %6d %6d %5d %3d%% %3d:%02d:%02d %3d:%02d:%02d %3d%%\n\n", \
"TOTALS", nxmt
, nxmt_accept
, nxmt_reject
, nxmt_failed
, \
they_take
, e_hours
, e_min
, e_sec
, c_hours
, c_min
, c_sec
, pct
);
printf("Transmission Connection Attempts ------errors-------\n");
printf("System Conn Ok EOF Sock Load Bpipe Space Exp Auth Other Pct\n");
for (sortindex in nntplink_site
)
if (nntplink_site
[sortindex
] >=
0 && sortindex
< s
)
errs = nntplink_eof
[s
] + nntplink_sockerr
[s
] + \
nntplink_hiload
[s
] + nntplink_bpipe
[s
] + \
nntplink_nospace
[s
] + nntplink_auth
[s
] + \
nntplink_expire
[s
] + nntplink_fail
[s
];
ok =
(nntplink_site
[s
] - errs
);
printf("%-20.20s %4d %4d %3d %4d %4d %5d %5d %4d %4d %5d %3d%%\n", \
s
, nntplink_site
[s
], ok
, nntplink_eof
[s
], \
nntplink_sockerr
[s
], nntplink_hiload
[s
], \
nntplink_bpipe
[s
], nntplink_nospace
[s
], \
nntplink_expire
[s
], nntplink_auth
[s
], nntplink_fail
[s
], \
ct_tot
+= nntplink_site
[s
];
ct_eof
+= nntplink_eof
[s
];
ct_sockerr
+= nntplink_sockerr
[s
];
ct_hiload
+= nntplink_hiload
[s
];
ct_bpipe
+= nntplink_bpipe
[s
];
ct_nospace
+= nntplink_nospace
[s
];
ct_auth
+= nntplink_auth
[s
];
ct_expire
+= nntplink_expire
[s
];
ct_fail
+= nntplink_fail
[s
];
printf("\n%-20.20s %4d %4d %3d %4d %4d %5d %5d %4d %4d %5d %3d%%\n\n", \
"TOTALS", ct_tot
, ct_ok
, ct_eof
, ct_sockerr
, ct_hiload
, \
ct_bpipe
, ct_nospace
, ct_expire
, ct_auth
, ct_fail
, \
printf("UUCP batches created\n");
printf("System Offrd Arts Bytes Elapsed Cpu Pct\n");
for (sortindex in batcher_site
)
if (batcher_site
[sortindex
] >=
0 && sortindex
< s
)
e_hours = batcher_times_elapsed
[s
] / 3600;
e_sec = batcher_times_elapsed
[s
] %
3600;
c_hours =
(batcher_times_user
[s
] + batcher_times_sys
[s
]) / 3600;
c_sec =
(batcher_times_user
[s
] + batcher_times_sys
[s
]) %
3600;
elapsed = batcher_times_elapsed
[s
];
pct =
((batcher_times_user
[s
] + batcher_times_sys
[s
]) * 100.0) / elapsed
;
printf("%-20.20s %6d %6d %10d %3d:%02d:%02d %3d:%02d:%02d %3d%%\n",\
s
, batcher_num
[s
], batcher_articles
[s
], batcher_bytes
[s
], \
e_hours
, e_min
, e_sec
, c_hours
, c_min
, c_sec
, pct
);
nbatch
+= batcher_num
[s
];
nbatch_articles
+= batcher_articles
[s
];
nbatch_bytes
+= batcher_bytes
[s
];
nbatch_ela
+= batcher_times_elapsed
[s
];
nbatch_cpu
+= batcher_times_user
[s
] + batcher_times_sys
[s
];
e_hours = nbatch_ela
/ 3600;
e_sec = nbatch_ela %
3600;
c_hours = nbatch_cpu
/ 3600;
c_sec = nbatch_cpu %
3600;
pct =
(nbatch_cpu
* 100.0) / nbatch_ela
;
printf("\n%-20.20s %6d %6d %10d %3d:%02d:%02d %3d:%02d:%02d %3d%%\n\n",\
"TOTALS", nbatch
, nbatch_articles
, nbatch_bytes
,\
e_hours
, e_min
, e_sec
, c_hours
, c_min
, c_sec
, pct
);
printf("Rnews articles offered from:\n");
for (sortindex in rnews_hosts
)
if (rnews_hosts
[sortindex
] >=
0 && sortindex
< s
)
printf("\t%6d\t%s\n", rnews_hosts
[s
], s
);
printf("Rnews connections rejected %d times\n", rnews_rejects
);
for (sortindex in rnews_r_reject
)
if (rnews_r_reject
[sortindex
] >=
0 && sortindex
< s
)
printf("\t%6d\t%s\n", rnews_r_reject
[s
], s
);
printf("Rnews bad articles: (Total %d)\n", rnews_bad
);
printf("Bad newsgroup: %d\n", rnews_bad_ng
);
for (sortindex in rnews_bng
)
if (rnews_bng
[sortindex
] >=
0 && sortindex
< s
)
printf("\t%5d: %s\n", rnews_bng
[s
], s
);
printf("Bad distribution: %d\n", rnews_bad_dist
);
for (sortindex in rnews_bdist
)
if (rnews_bdist
[sortindex
] >=
0 && sortindex
< s
)
printf("\t%5d: %s\n", rnews_bdist
[s
], s
);
printf("Bad date: %d\n", rnews_bad_date
);
printf("NNRP readership statistics\n");
printf("System Conn Articles Groups Post Rej Elapsed CPU Pct\n");
for (sortindex in nnrp_connect
)
if (nnrp_connect
[sortindex
] >=
0 && sortindex
< s
)
## Report curious pokers elsewhere.
if (nnrp_groups
[s
] ==
0 \
&& nnrp_articles
[s
] ==
0 \
nnrp_curious
[s
] += nnrp_connect
[s
];
nconn
+= nnrp_connect
[s
];
nart
+= nnrp_articles
[s
];
nrej
+= nnrp_rejected
[s
];
ncpu
+=
(nnrp_times_user
[s
] + nnrp_times_sys
[s
]);
nela
+= nnrp_times_elapsed
[s
];
e_hours = nnrp_times_elapsed
[s
] / 3600;
e_sec = nnrp_times_elapsed
[s
] %
3600;
c_hours =
(nnrp_times_user
[s
] + nnrp_times_sys
[s
]) / 3600;
c_sec =
(nnrp_times_user
[s
] + nnrp_times_sys
[s
]) %
3600;
elapsed = nnrp_times_elapsed
[s
];
pct =
((nnrp_times_user
[s
] + nnrp_times_sys
[s
]) * 100.0) / elapsed
;
printf("%-20.20s %5d %8d %6d %4d %4d %3d:%02d:%02d %3d:%02d:%02d %3d%%\n",\
s
, nnrp_connect
[s
], nnrp_articles
[s
], nnrp_groups
[s
],\
nnrp_posts
[s
], nnrp_rejected
[s
], e_hours
, e_min
, e_sec
,\
c_hours
, c_min
, c_sec
, pct
);
pct =
(ncpu
* 100.0) / nela
;
printf("\n%-20.20s %5d %8d %6d %4d %4d %3d:%02d:%02d %3d:%02d:%02d %3d%%\n\n",\
"TOTALS", nconn
, nart
, ngrp
, npost
, nrej
, e_hours
, e_min
, \
e_sec
, c_hours
, c_min
, c_sec
, pct
);
## Miscellaneous NNRP statistics.
printf("Curious NNRP server explorers\n");
for (sortindex in nnrp_curious
)
if (nnrp_curious
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, nnrp_curious
[s
]);
printf("NNRP no permission clients\n");
for (sortindex in nnrp_noperm
)
if (nnrp_noperm
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, nnrp_noperm
[s
]);
printf("NNRP unrecognized commands\n");
for (sortindex in nnrp_unrec
)
if (nnrp_unrec
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, nnrp_unrec
[s
]);
printf("NNRP gethostbyname failures\n");
for (sortindex in nnrp_gethostfail
)
if (nnrp_gethostfail
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, nnrp_gethostfail
[s
]);
nnrp_gethostfail
[s
] =
-1;
printf("NNRP client timeouts\n");
for (sortindex in nnrp_timeout
)
if (nnrp_timeout
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, nnrp_timeout
[s
]);
printf("NNTPLINK remote server timeouts\n");
for (sortindex in nntplink_timeout
)
if (nntplink_timeout
[sortindex
] >=
0 && sortindex
< s
)
printf("%-20.20s %5d\n", s
, nntplink_timeout
[s
]);
nntplink_timeout
[s
] =
-1;
printf("Mthreads: Starts Groups on Groups off Articles Expired\n");
printf("%18d%12d%12d%12d%12d\n", mthreads_started
, mthreads_turned_on
, \
mthreads_turned_off
, mthreads_added
, mthreads_expired
);
## Group readership statistics.
for (g in nnrp_group_request
) {
top =
substr(g
, 1, i
- 1);
category
[top
] += nnrp_group_request
[g
];
fmt =
sprintf("%%-%ds %%5d\n", max
);
printf("Newsgroup request counts (by category)\n");
for (sortindex in category
)
if (category
[sortindex
] >=
0 && sortindex
< s
)
printf(fmt
, s
, category
[s
]);
printf("Newsgroup request counts (by newsgroup)\n");
for (sortindex in nnrp_group_request
)
if (nnrp_group_request
[sortindex
] >=
0 && sortindex
< s
)
printf(fmt
, s
, nnrp_group_request
[s
]);
nnrp_group_request
[s
] =
-1;