#!/usr/local/bin/perl -- ########################################################################## # # innreport.pl (Perl version for innlog[.awk] with HTML output)) # # version : 2.0b4 # # Copyright (c) 1996, Fabien TASSIN (tassin@eerie.fr). # # Changes: # 09/06/96: 2.0b4 - index bug corrected. # 09/05/96: 2.0b3 - new log entries from the latest innfeed. # 09/04/96: 2.0b2 - minor bugs corrected. Features added by request. # 08/29/96: 2.0b1 - New name to avoid confusion with another innlog.pl. # New index. A lot of new options. # 08/26/96: 1.1b3 - possibility to use HTML without graphs. # Rotation of reports + index + different new options. # 08/23/96: 1.1b2 - minor changes with graphs. Index. # small bug (corrected) for pics path (thanx, wolf :) # 08/23/96: 1.1b1 - major changes. Graphs (need GD). # Archives. # 08/21/96: 1.0b4 - minor changes for innfeed and nnntplink. # support for inndstart, rnews and batcher. # 08/03/96: 1.0b3 - minor changes for innd. # Table for unrecognize commands. # 08/02/96: 1.0b2 - support for nntplink and innfeed. # fixed for Perl4 users. # 08/01/96: 1.0b1 - creation. # # ABSOLUTELY NO WARRANTY WITH THIS PACKAGE. USE IT AT YOUR OWN RISKS. # # Note : You need the Perl graphic library GD.pm # GD is available on all good CPAN ftp site : # [CPAN_DIR]/authors/id/LDS/GD-1.01.tar.gz # or directly to : # http://www-genome.wi.mit.edu/pub/software/WWW/GD.html # Before compiling "GD", you need "gd" (see both documentations # for full details). gd can be obtained from that site : # http://www.boutell.com/gd/ # # Install: - check the Perl location (first line) # - look at the parameters. # - copy this script into ${NEWSLIB}/innreport.pl # - be sure that news can use it (chmod 755 or 750) # - in "scanlog", comment the line containing innlog.awk and add : # ${NEWSLIB}/innreport.pl < ${OLD_SYSLOG} # # Report : please report bugs directly to the author. # Please also report unknown entries. # Be sure your are using the latest version of this script. # (check ftp://anais.eerie.fr/pub/usenet/innreport/) # ########################################################################## ## Uncomment next line if you want to create a Web page $HTML = "comment_or_uncomment"; ## Uncomment these two lines if you want graphs (need $HTML too). $GRAPH = "comment_or_uncomment"; use GD; ## Directory for the Web pages (used only if the previous line is active) $HTML_dir = "/var/www/News/stats/"; ## Directory for the GIF pictures (need HTML support) in the file space $IMG_dir = "$HTML_dir/pics"; ## Directory for the GIF pictures (need HTML support) in the Web space ## (can be relative or global) $IMG_pth = "pics"; ## Uncomment next line if you want to archive HTML results (& pics) ## [ will add a date in each names ]. $ARCHIVE = "comment_or_uncomment"; ## index page will be called : $index = "index.html"; ## How many report files to keep (0 = all). $CYCLE = 0; ## How many lines to display in the "Newsgroup request counts (by ng)" ## (-1 = all, 0 = no report for this) $NGMAX = -1; ## Comment next line to skip client timeouts report $TIMEOUT = "comment_or_uncomment"; ## Uncomment next line if you want the "Program log" tab # $PRGTAB = "comment_or_uncomment"; ############################################### ## THERE'S NOTHING TO CHANGE AFTER THIS LINE ## ############################################### $version = "2.0b4"; umask (022); if ($HTML) { if ($GRAPH) { $IMG_pth .= "/"; $IMG_pth =~ s|/+|/|g; $IMG_dir =~ s|/+|/|g; die "Error : cant open $IMG_dir\n" unless (-w $IMG_dir); } die "Error : cant open $HTML_dir\n" unless (-w $HTML_dir); # Create a new filename (unique and _sortable_) if ($ARCHIVE) { ($ts, $tm, $th, $dd, $dm, $dy) = localtime; $dm++; # January = 0 not 1 $suffix = sprintf (".%02d.%02d.%02d-%02d:%02d:%02d", $dy, $dm, $dd, $th, $tm, $ts); } else { $suffix = ""; } $HTML_output = "$HTML_dir" . "/news-notice" . "$suffix" . ".html"; $HTML_output =~ s|/+|/|g; } if ($HTML) { open (HTML, "> $HTML_output") || die "Error : cant open $HTML_output\n"; print HTML "\n
\n\n"; # Index print HTML "
\n";
}
if (@unrecognize)
{
print HTML "\n" if ($HTML);
print "Unknown entries from news log file :\n";
print HTML "Unknown entries from news log file : \n" if ($HTML);
for $l (0 .. $#unrecognize)
{
print "$unrecognize[$l]";
print HTML "$unrecognize[$l] \n" if ($HTML);
}
if ((%prog_type) && ($PRGTAB))
{
print HTML "\n" if ($HTML);
print "Log entries by :\n";
print "Program name Number\n";
if ($HTML)
{
print HTML "Log entries by : \n" ;
print HTML " \n" if ($HTML);
print "\n";
}
if (%innd_control)
{
print HTML "\n" if ($HTML);
print "Control commands to INND :\n";
print "Command Number\n";
if ($HTML)
{
print HTML "Control commands to INND : \n" ;
print HTML " \n" if ($HTML);
print "\n";
}
if (%innd_connect)
{
print HTML "\n" if ($HTML);
# Graph size..
$xmax = 500;
$ymax = 300;
$h_max = 0;
$nb_max = 0;
$i = 0;
print "Articles received by server :\n";
print "Server Connects Offered Took Refuse Rejct Accpt Elapsed\n";
if ($HTML)
{
print HTML "Articles received by server : \n";
print HTML " \n";
if ($GRAPH)
{
# Draw graph...
$marginx = 20;
$marginy = 30;
$inter = 20;
$w = sprintf ("%d",
(($xmax - 2 * $marginx) -
($nb_max - 1) * ($inter)) / ($nb_max));
if ($w < 5)
{
$w = 5;
$xmax = 2 * $marginx + ($inter + $w) * $nb_max - $inter;
}
if ($w > 50)
{
$w = 50;
$marginx = ($xmax - $nb_max * $w) / ($nb_max + 1);
$inter = $marginx;
}
$ratio = ($ymax - 2 * $marginy) / $h_max;
$image = new GD::Image($xmax, $ymax);
$white = $image->colorAllocate (255, 255, 255);
$black = $image->colorAllocate ( 0, 0, 0);
$red = $image->colorAllocate (255, 0, 0);
$blue = $image->colorAllocate ( 0, 0, 255);
$green = $image->colorAllocate ( 0, 255, 0);
$image->transparent ($white);
foreach $host (sort (keys (%innd_connect)))
{
$image->stringUp (gdSmallFont,
$marginx + $i * ($w + $inter) - 14 , $ymax - $marginy,
"$host", $black);
$image->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy - $innd_accepted{$host} * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy, $black);
$image->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy -
($innd_accepted{$host} +
$innd_refused{$host}) * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy -
$innd_accepted{$host} * $ratio, $black);
$image->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy - ($innd_accepted{$host} +
$innd_refused{$host} +
$innd_rejected{$host}) * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy -
($innd_accepted{$host} +
$innd_refused{$host}) * $ratio,
$black);
$image->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy - 1, $blue)
if ($innd_accepted{$host} * $ratio > 2);
$image->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy - $innd_accepted{$host} * $ratio - 1,
$red)
if ($innd_refused{$host} * $ratio > 2);
$image->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy -
($innd_accepted{$host} + $innd_refused{$host}) *
$ratio - 1, $green)
if ($innd_rejected{$host} * $ratio > 2);
$i++;
}
$marginx = 20;
$image->rectangle ($marginx, 5, $marginx + 15, 20, $black);
$image->fill ($marginx + 1, 6, $blue);
$image->string (gdSmallFont,
$marginx + 20, 13.5 - gdSmallFont->height / 2,
"Articles accepted", $black);
$image->rectangle ($xmax / 2 - 50, 5, $xmax / 2 - 35, 20, $black);
$image->fill ($xmax / 2 - 49, 6, $red);
$image->string (gdSmallFont,
$xmax / 2 - 30, 13.5 - gdSmallFont->height / 2,
"Articles refused", $black);
$image->rectangle ($xmax - 160, 5, $xmax - 145, 20, $black);
$image->fill ($xmax - 159, 6, $green);
$image->string (gdSmallFont,
$xmax - 140, 13.5 - gdSmallFont->height / 2,
"Articles rejected", $black);
$image->rectangle (0, 0, $xmax - 1, 25, $black);
$image->rectangle (0, 0, $xmax - 1, $ymax - 1, $black);
$image->string (gdSmallFont, 170, $ymax - 5 - gdSmallFont->height,
"Articles received by server", $black);
print HTML " \n";
close (HTML);
open (IMG, "> $IMG_dir/innd$suffix.gif") || die "Can't create img\n";
print IMG $image->gif;
close (IMG);
open (HTML, ">> $HTML_output") ||
die "Error : cant open $HTML_output\n";
}
print HTML " \n";
}
}
if ((%innd_bad_ihave) || (%innd_bad_msgid) ||
(%innd_bad_sendme) || (%innd_bad_command))
{
print HTML "\n" if ($HTML);
print "Miscellaneous innd statistics :\n";
$misc = 0;
if ($HTML)
{
print HTML "Miscellaneous innd statistics : \n";
print HTML " \n" if ($HTML);
}
if (%innd_blocked)
{
print HTML "\n" if ($HTML);
print "Blocked server feeds :\n";
if ($HTML)
{
print HTML "Blocked server feeds : \n";
print HTML " \n" if ($HTML);
}
if (%innd_huge)
{
print HTML "\n" if ($HTML);
print "Servers sending huge articles :\n";
print "System Articles\n";
if ($HTML)
{
print HTML "Server sending huge articles : \n";
print HTML " \n" if ($HTML);
}
if (%innfeed_seconds)
{
print HTML "\n" if ($HTML);
# Graph size..
$xmax = 500;
$ymax = 300;
$h_max = 0;
$nb_max = 0;
print "Articles sent by innfeed :\n";
print "Server Offered Took Refuse Rejct Miss Spool Accpt Elapsed \n";
if ($HTML)
{
print HTML "Articles sent by innfeed : \n";
print HTML " \n";
if ($GRAPH)
{
# Draw graph...
$marginx = 20;
$marginy = 30;
$inter = 20;
$i = 0;
$w = sprintf ("%d",
(($xmax - 2 * $marginx) -
($nb_max - 1) * ($inter)) / ($nb_max));
if ($w < 5)
{
$w = 5;
$xmax = 2 * $marginx + ($inter + $w) * $nb_max - $inter;
}
if ($w > 50)
{
$w = 50;
$marginx = ($xmax - $nb_max * $w) / ($nb_max + 1);
$inter = $marginx;
}
$ratio = ($ymax - 2 * $marginy) / $h_max;
$img2 = new GD::Image($xmax, $ymax);
$white = $img2->colorAllocate (255, 255, 255);
$black = $img2->colorAllocate ( 0, 0, 0);
$red = $img2->colorAllocate (255, 0, 0);
$blue = $img2->colorAllocate ( 0, 0, 255);
$img2->transparent ($white);
foreach $host (sort (keys (%innfeed_offered)))
{
$img2->stringUp (gdSmallFont,
$marginx + $i * ($w + $inter) - 14 , $ymax - $marginy,
"$host", $black);
$img2->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy - $innfeed_accepted{$host} * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy, $black);
$img2->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy -
$innfeed_offered{$host} * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy - $innfeed_accepted{$host} * $ratio,
$black);
$img2->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy - 1, $blue)
if ($innfeed_accepted{$host} * $ratio > 2);
$img2->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy - $innfeed_accepted{$host} * $ratio - 1,
$red)
if (($innfeed_offered{$host} -
$innfeed_accepted{$host}) * $ratio > 2);
$i++;
}
$marginx = 30;
$img2->rectangle ($marginx, 5, $marginx + 15, 20, $black);
$img2->fill ($marginx + 1, 6, $blue);
$img2->string (gdSmallFont,
$marginx + 20, 13.5 - gdSmallFont->height / 2,
"Articles accepted", $black);
$img2->rectangle ($xmax - 160, 5, $xmax - 145, 20, $black);
$img2->fill ($xmax - 159, 6, $red);
$img2->string (gdSmallFont,
$xmax - 140, 13.5 - gdSmallFont->height / 2,
"Others", $black);
$img2->rectangle (0, 0, $xmax - 1, 25, $black);
$img2->rectangle (0, 0, $xmax - 1, $ymax - 1, $black);
$img2->string (gdSmallFont, 170, $ymax - 5 - gdSmallFont->height,
"Articles sent by innfeed", $black);
print HTML
" \n";
close (HTML);
open (IMG, "> $IMG_dir/innfeed$suffix.gif") || die "Can't create img\n";
print IMG $img2->gif;
close (IMG);
open (HTML, ">> $HTML_output") ||
die "Error : cant open $HTML_output\n";
}
print HTML " \n";
}
}
if (%nntplink_connects)
{
print HTML "\n" if ($HTML);
# Graph size..
$xmax = 500;
$ymax = 300;
$h_max = 0;
$nb_max = 0;
print "Articles sent by nntplink :\n";
print "Server Offered Took Rejct Failed Accpt Elapsed\n";
if ($HTML)
{
print HTML "Articles sent by nntplink : \n";
print HTML " \n";
if ($GRAPH)
{
# Draw graph...
$marginx = 20;
$marginy = 30;
$inter = 20;
$i = 0;
$w = sprintf ("%d",
(($xmax - 2 * $marginx) -
($nb_max - 1) * ($inter)) / ($nb_max));
if ($w < 5)
{
$w = 5;
$xmax = 2 * $marginx + ($inter + $w) * $nb_max - $inter;
}
if ($w > 50)
{
$w = 50;
$marginx = ($xmax - $nb_max * $w) / ($nb_max + 1);
$inter = $marginx;
}
$ratio = ($ymax - 2 * $marginy) / $h_max;
$img2 = new GD::Image($xmax, $ymax);
$white = $img2->colorAllocate (255, 255, 255);
$black = $img2->colorAllocate ( 0, 0, 0);
$red = $img2->colorAllocate (255, 0, 0);
$blue = $img2->colorAllocate ( 0, 0, 255);
$img2->transparent ($white);
foreach $host (sort (keys (%nntplink_site)))
{
$img2->stringUp (gdSmallFont,
$marginx + $i * ($w + $inter) - 14 , $ymax - $marginy,
"$host", $black);
$img2->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy -
$nntplink_accepted{$host} * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy, $black);
$img2->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy -
$nntplink_offered{$host} * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy -
$nntplink_accepted{$host} * $ratio,
$black);
$img2->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy - 1, $blue)
if ($nntplink_accepted{$host} * $ratio > 2);
$img2->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy -
$nntplink_accepted{$host} * $ratio - 1,
$red)
if (($nntplink_offered{$host} -
$nntplink_accepted{$host}) * $ratio > 2);
$i++;
}
$marginx = 30;
$img2->rectangle ($marginx, 5, $marginx + 15, 20, $black);
$img2->fill ($marginx + 1, 6, $blue);
$img2->string (gdSmallFont,
$marginx + 20, 13.5 - gdSmallFont->height / 2,
"Articles accepted", $black);
$img2->rectangle ($xmax - 160, 5, $xmax - 145, 20, $black);
$img2->fill ($xmax - 159, 6, $red);
$img2->string (gdSmallFont,
$xmax - 140, 13.5 - gdSmallFont->height / 2,
"Others", $black);
$img2->rectangle (0, 0, $xmax - 1, 25, $black);
$img2->rectangle (0, 0, $xmax - 1, $ymax - 1, $black);
$img2->string (gdSmallFont, 170, $ymax - 5 - gdSmallFont->height,
"Articles sent by nntplink", $black);
$fname = "$IMG_pth" . "nntplink$suffix.gif";
print HTML
" \n";
# print HTML
# " \n";
close (HTML);
open (IMG, "> $IMG_dir/nntplink$suffix.gif") || die "Can't create img\n";
print IMG $img2->gif;
close (IMG);
open (HTML, ">> $HTML_output") ||
die "Error : cant open $HTML_output\n";
}
}
print "Transmission Connection Attempts ------errors-------\n";
print "Server Conn Ok EOF Sock Slct Load Bpip Spce Exp Auth Othr Pct\n";
if ($HTML)
{
print HTML "Transmission Connection Attempts : \n";
print HTML " \n";
}
}
if (%innxmit_times)
{
print HTML "\n" if ($HTML);
# Graph size..
$xmax = 500;
$ymax = 300;
$h_max = 0;
$nb_max = 0;
print "Articles sent by innxmit :\n";
print "System Offrd Took Refuse Rejct Accpt Elapsed\n";
if ($HTML)
{
print HTML "Articles sent by innxmit : \n";
print HTML " \n";
if ($GRAPH)
{
# Draw graph...
$marginx = 20;
$marginy = 30;
$inter = 20;
$i = 0;
$w = sprintf ("%d",
(($xmax - 2 * $marginx) -
($nb_max - 1) * ($inter)) / ($nb_max));
if ($w < 5)
{
$w = 5;
$xmax = 2 * $marginx + ($inter + $w) * $nb_max - $inter;
}
if ($w > 50)
{
$w = 50;
$marginx = ($xmax - $nb_max * $w) / ($nb_max + 1);
$inter = $marginx;
}
$ratio = ($ymax - 2 * $marginy) / $h_max;
$img2 = new GD::Image($xmax, $ymax);
$white = $img2->colorAllocate (255, 255, 255);
$black = $img2->colorAllocate ( 0, 0, 0);
$red = $img2->colorAllocate (255, 0, 0);
$blue = $img2->colorAllocate ( 0, 0, 255);
$img2->transparent ($white);
foreach $host (sort (keys (%innxmit_offered)))
{
$img2->stringUp (gdSmallFont,
$marginx + $i * ($w + $inter) - 14 , $ymax - $marginy,
"$host", $black);
$img2->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy - $innxmit_accepted{$host} * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy, $black);
$img2->rectangle ($marginx + $i * ($w + $inter),
$ymax - $marginy -
$innxmit_offered{$host} * $ratio,
$marginx + $i * ($w + $inter) + $w,
$ymax - $marginy - $innxmit_accepted{$host} * $ratio,
$black);
$img2->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy - 1, $blue)
if ($innxmit_accepted{$host} * $ratio > 2);
$img2->fill ($marginx + $i * ($w + $inter) + 1,
$ymax - $marginy - $innxmit_accepted{$host} * $ratio - 1,
$red)
if (($innxmit_offered{$host} -
$innxmit_accepted{$host}) * $ratio > 2);
$i++;
}
$marginx = 30;
$img2->rectangle ($marginx, 5, $marginx + 15, 20, $black);
$img2->fill ($marginx + 1, 6, $blue);
$img2->string (gdSmallFont,
$marginx + 20, 13.5 - gdSmallFont->height / 2,
"Articles accepted", $black);
$img2->rectangle ($xmax - 160, 5, $xmax - 145, 20, $black);
$img2->fill ($xmax - 159, 6, $red);
$img2->string (gdSmallFont,
$xmax - 140, 13.5 - gdSmallFont->height / 2,
"Others", $black);
$img2->rectangle (0, 0, $xmax - 1, 25, $black);
$img2->rectangle (0, 0, $xmax - 1, $ymax - 1, $black);
$img2->string (gdSmallFont, 170, $ymax - 5 - gdSmallFont->height,
"Articles sent by innxmit", $black);
print HTML
" \n";
close (HTML);
open (IMG, "> $IMG_dir/innxmit$suffix.gif") || die "Can't create img\n";
print IMG $img2->gif;
close (IMG);
open (HTML, ">> $HTML_output") ||
die "Error : cant open $HTML_output\n";
}
}
print "Transmission Connection Attempts ------errors-------------------\n";
print "Server Conn Ok Auth Load Space Expire Connct Other Pct\n";
if ($HTML)
{
print HTML "Transmission Connection Attempts : \n";
print HTML " \n";
}
}
if (%batcher_elapsed)
{
print HTML "\n" if ($HTML);
print "UUCP batches created :\n";
print "System Offered Articles Bytes Elapsed\n";
if ($HTML)
{
print HTML "UUCP batches created : \n";
print HTML " \n";
}
}
if (%rnews_host)
{
print HTML "\n" if ($HTML);
print "Rnews articles offered from :\n";
print "System Offered\n";
if ($HTML)
{
print HTML "Rnews articles offered from : \n";
print HTML " \n";
print HTML " \n" unless ((%rnews_rejected) || (%rnews_bogus_ng)
|| (%rnews_bogus_dist) || (%rnews_bogus_date));
}
}
if (%rnews_rejected)
{
print HTML "\n" if ($HTML);
print "Rnews connections rejected :\n";
print "Reason Connections\n";
if ($HTML)
{
print HTML "Rnews connections rejected : \n";
print HTML " \n";
print HTML " \n" unless ((%rnews_bogus_ng)
|| (%rnews_bogus_dist) || (%rnews_bogus_date));
}
}
if ((%rnews_bogus_ng) || (%rnews_bogus_dist) || (%rnews_bogus_date))
{
print HTML "\n" if ($HTML);
print "Rnews bad articles :\n";
print "Reason Element Number\n";
if ($HTML)
{
print HTML "Rnews bad articles : \n";
print HTML " \n";
print HTML " \n";
}
if (%nnrpd_groups)
{
$reader = 0;
print HTML "\n" if ($HTML);
print "NNRP readership statistics :\n";
print "System Conn Arts Groups Post Rej Elapsed\n";
if ($HTML)
{
print HTML "NNRP readership statistics : \n";
print HTML " \n";
}
}
# Look for curious explorers
if (%nnrpd_groups)
{
print HTML "\n" if ($HTML);
foreach $serv (sort(keys (%nnrpd_groups)))
{
$curious = "ok"
if (($nnrpd_groups{$serv} == 0) && ($nnrpd_post_ok{$serv} == 0));
}
if ($curious eq "ok")
{
print "Curious NNRP server explorers :\n";
print "System Conn\n";
if ($HTML)
{
print HTML "Curious NNRP server explorers : \n";
print HTML " \n" if ($HTML);
}
}
if (%nnrpd_no_permission)
{
print HTML "\n" if ($HTML);
print "NNRP no permission clients :\n";
print "System Conn\n";
if ($HTML)
{
print HTML "NNRP no permission clients : \n";
print HTML " \n" if ($HTML);
}
if (%nnrpd_gethostbyaddr)
{
print HTML "\n" if ($HTML);
print "NNRP gethostbyaddr failures :\n";
print "IP Conn\n";
if ($HTML)
{
print HTML "NNRP gethostbyaddr failures : \n";
print HTML " \n" if ($HTML);
}
if ($nnrpd_getpeername != 0)
{
print HTML "\n" if ($HTML);
print "NNRP getpeername failures : $nnrpd_getpeername\n";
print "\n";
if ($HTML)
{
print HTML "NNRP getpeername failures : $nnrpd_getpeername\n";
print HTML " \n";
}
}
if (%nnrpd_unrecognized)
{
print HTML "\n" if ($HTML);
print "NNRP unrecognized commands (by host) :\n";
print "System Commands\n";
if ($HTML)
{
print HTML "NNRP unrecognized commands (by host) : \n";
print HTML " \n" if ($HTML);
print "NNRP unrecognized commands (by command):\n";
print "Command Hits\n";
if ($HTML)
{
print HTML "NNRP unrecognized commands (by command) : \n";
print HTML " \n" if ($HTML);
}
if ((%nnrpd_timeout) && ($TIMEOUT))
{
$t_o = 0;
$t_p = 0;
$t_c = 0;
print HTML "\n" if ($HTML);
print "NNRP client timeouts :\n";
print "System Conn Peer\n";
if ($HTML)
{
print HTML "NNRP client timeouts : \n";
print HTML " \n";
}
}
if (%nnrpd_hierarchy)
{
print HTML "\n" if ($HTML);
# Graph size..
$xmax = 500;
$ymax = 300;
$max = 0;
print "Newsgroup request counts (by category) :\n";
if ($HTML)
{
print HTML "Newsgroup request counts (by category) : \n";
print HTML " \n";
print HTML " \n";
print HTML " \n";
close (HTML);
open (IMG, "> $IMG_dir/hierarchy$suffix.gif") || die "Can't create img\n";
print IMG $image->gif;
close (IMG);
open (HTML, ">> $HTML_output") || die "Error : cant open $HTML_output\n";
}
}
if ((%nnrpd_group) && ($NGMAX))
{
$total_grp = 0;
$total_acc = 0;
$msg = "";
$msg = "[ Top $NGMAX ] " if ($NGMAX > 0);
print HTML "\n" if ($HTML);
print "Newsgroup request counts (by newsgroup) $msg:\n";
if ($HTML)
{
print HTML "Newsgroup request counts (by newsgroup) $msg: \n";
print HTML " \n";
if ($GRAPH)
{
print INDEX " \n";
print INDEX " \n";
}
print INDEX "
" if ($HTML);
}
print "\n";
print HTML "\n";
print HTML "
\n Program name Number \n";
}
foreach $prg (sort(keys (%prog_type)))
{
printf ("%-64.64s %5d\n", $prg, $prog_type{$prg});
printf HTML (" \n",
$prg, $prog_type{$prg}) if ($HTML);
}
print HTML "%s %d \n";
print HTML "
\n Command Number \n";
}
foreach $cmd (sort(keys (%innd_control)))
{
printf ("%-40.40s %5d\n", $cmd, $innd_control{$cmd});
printf HTML (" \n",
$cmd, $innd_control{$cmd}) if ($HTML);
}
print HTML "%s %d \n
\n Server ";
print HTML " Connects ";
print HTML " Offered Took ";
print HTML " Refused Rejected Accepted ";
print HTML " Elapsed \n";
}
$tt = 0;
foreach $serv (sort (keys (%innd_connect)))
{
$tt += $innd_seconds{$serv};
$t = &second2time ($innd_seconds{$serv});
$offrd = $innd_accepted{$serv} + $innd_refused{$serv} +
$innd_rejected{$serv};
# Compute graph size..
$nb_max++;
$h_max = $offrd if ($offrd > $h_max);
if ($offrd == 0)
{
printf ("%-25.25s %5d %7d %7d %7d %7d %4d%% %9s\n",
$serv, $innd_connect{$serv}, $offrd,
$innd_accepted{$serv}, $innd_refused{$serv},
$innd_rejected{$serv}, 0, $t);
if ($HTML)
{
printf HTML (" \n",
0, $t);
}
}
else
{
printf ("%-25.25s %5d %7d %7d %7d %7d %4d%% %9s\n",
$serv, $innd_connect{$serv}, $offrd,
$innd_accepted{$serv}, $innd_refused{$serv},
$innd_rejected{$serv}, $innd_accepted{$serv} / $offrd * 100, $t);
if ($HTML)
{
printf HTML (" %s %d ",
$serv, $innd_connect{$serv});
printf HTML (" %d %d ",
$offrd, $innd_accepted{$serv});
printf HTML (" %d %d ",
$innd_refused{$serv}, $innd_rejected{$serv});
printf HTML (" %d%% %s \n",
$innd_accepted{$serv} / $offrd * 100, $t);
}
}
$innd_connect += $innd_connect{$serv};
$innd_accepted += $innd_accepted{$serv};
$innd_refused += $innd_refused{$serv};
$innd_rejected += $innd_rejected{$serv};
}
print "\n";
$t = &second2time ($tt);
$offrd = $innd_accepted + $innd_refused + $innd_rejected;
printf ("%-25.25s %5d %7d %7d %7d %7d %4d%% %9s \n",
"TOTAL", $innd_connect, $offrd,
$innd_accepted, $innd_refused,
$innd_rejected, $innd_accepted / $offrd * 100, $t);
print "\n";
if ($HTML)
{
print HTML " %s %d ",
$serv, $innd_connect{$serv});
printf HTML (" %d %d ",
$offrd, $innd_accepted{$serv});
printf HTML (" %d %d ",
$innd_refused{$serv}, $innd_rejected{$serv});
printf HTML (" %d%% %s \n";
printf HTML (" \n",
$innd_accepted / $offrd * 100, $t);
print HTML " %s %d ",
"TOTAL", $innd_connect);
printf HTML (" %d %d ",
$offrd, $innd_accepted);
printf HTML (" %d %d ",
$innd_refused, $innd_rejected);
printf HTML (" %d%% %s \n";
print HTML "
\n";
}
if (%innd_bad_ihave)
{
print "Bad ihave control messages received :\n";
print HTML
" Reason System Number \n"
if ($HTML);
foreach $host (sort keys %innd_bad_ihave)
{
$misc += $innd_bad_ihave{$host};
printf (" %-50.50s %5d\n", $host, $innd_bad_ihave{$host});
printf HTML ("Bad ihave control messages received \n",
$host, $innd_bad_ihave{$host}) if ($HTML);
}
}
if (%innd_bad_msgid)
{
print "Bad Message-ID's offered :\n";
print HTML
" %-50.50s %5d \n"
if ($HTML);
foreach $host (sort keys %innd_bad_msgid)
{
$misc += $innd_bad_msgid{$host};
printf (" %-50.50s %5d\n", $host, $innd_bad_msgid{$host});
printf HTML
("Bad Message-ID's offered \n",
$host, $innd_bad_msgid{$host}) if ($HTML);
}
}
if (%innd_bad_sendme)
{
print "Ignored sendme control messages received :\n";
print HTML
" %-50.50s %5d \n"
if ($HTML);
foreach $host (sort keys %innd_bad_sendme)
{
$misc += $innd_bad_sendme{$host};
printf (" %-50.50s %5d\n", $host, $innd_bad_sendme{$host});
printf HTML
("Ignored sendme control messages received \n",
$host, $innd_bad_sendme{$host}) if ($HTML);
}
}
if (%innd_bad_command)
{
print "Bad command received :\n";
print HTML
" %-50.50s %5d \n"
if ($HTML);
foreach $host (sort keys %innd_bad_command)
{
$misc += $innd_bad_command{$host};
printf (" %-50.50s %5d\n", $host, $innd_bad_command{$host});
printf HTML
("Bad command received \n",
$host, $innd_bad_command{$host}) if ($HTML);
}
}
print "\n";
printf ("%-50.50s %5d\n", "TOTAL", $misc);
print "\n";
printf HTML
(" %-50.50s %5d \n",
$misc) if ($HTML);
print HTML " TOTAL %5d \n
\n System ";
print HTML " Number ";
print HTML "\n";
}
foreach $serv (sort(keys (%innd_blocked)))
{
printf ("%-64.64s %5d\n",
$serv, $innd_blocked{$serv});
if ($HTML)
{
printf HTML (" \n",
$serv, $innd_blocked{$serv});
}
}
print "\n";
print HTML " %s %d \n
\n System ";
print HTML " Articles ";
print HTML "\n";
}
foreach $serv (sort(keys (%innd_huge)))
{
printf ("%-64.64s %5d\n",
$serv, $innd_huge{$serv});
if ($HTML)
{
printf HTML (" \n",
$serv, $innd_huge{$serv});
}
}
print "\n";
print HTML " %s %d \n
\n Server ";
print HTML " Offered ";
print HTML " Took Refused Rejected ";
print HTML " Missing Spooled Accepted ";
print HTML " Elapsed ";
print HTML "\n";
}
$tt = 0;
foreach $serv (sort(keys (%innfeed_offered)))
{
$tt += $innfeed_seconds{$serv};
$t = &second2time ($innfeed_seconds{$serv});
# Compute graph size..
$nb_max++;
$h_max = $innfeed_offered{$serv} if ($innfeed_offered{$serv} > $h_max);
if ($innfeed_offered{$serv} == 0)
{
printf ("%-20.20s %7d %7d %7d %5d %5d %6d %4d%% %9s\n",
$serv, $innfeed_offered{$serv},
$innfeed_accepted{$serv}, $innfeed_refused{$serv},
$innfeed_rejected{$serv},
$innfeed_missing{$serv}, $innfeed_spooled{$serv}, 0, $t);
if ($HTML)
{
printf HTML (" \n", $t);
}
}
else
{
printf ("%-20.20s %7d %7d %7d %5d %5d %6d %4d%% %9s\n",
$serv, $innfeed_offered{$serv},
$innfeed_accepted{$serv}, $innfeed_refused{$serv},
$innfeed_rejected{$serv}, $innfeed_missing{$serv},
$innfeed_spooled{$serv},
$innfeed_accepted{$serv} / $innfeed_offered{$serv} * 100, $t);
if ($HTML)
{
printf HTML (" %s ",
$serv);
printf HTML (" %d ",
$innfeed_offered{$serv});
printf HTML (" %d %d ",
$innfeed_accepted{$serv}, $innfeed_refused{$serv});
printf HTML (" %d %d ",
$innfeed_rejected{$serv}, $innfeed_missing{$serv});
printf HTML (" %d %d%% ",
$innfeed_spooled{$serv}, 0);
printf HTML (" %s \n", $t);
}
}
$innfeed_offered += $innfeed_offered{$serv};
$innfeed_connect += $innfeed_connect{$serv};
$innfeed_accepted += $innfeed_accepted{$serv};
$innfeed_refused += $innfeed_refused{$serv};
$innfeed_rejected += $innfeed_rejected{$serv};
$innfeed_missing += $innfeed_missing{$serv};
$innfeed_spooled += $innfeed_spooled{$serv};
}
print "\n";
$t = &second2time ($tt);
printf ("%-20.20s %7d %7d %7d %5d %5d %6d %4d%% %9s\n",
"TOTAL", $innfeed_offered, $innfeed_accepted,
$innfeed_refused, $innfeed_rejected, $innfeed_missing,
$innfeed_spooled, $innfeed_accepted / $innfeed_offered * 100, $t);
print "\n";
if ($HTML)
{
print HTML " %s ",
$serv);
printf HTML (" %d ",
$innfeed_offered{$serv});
printf HTML (" %d %d ",
$innfeed_accepted{$serv}, $innfeed_refused{$serv});
printf HTML (" %d %d ",
$innfeed_rejected{$serv}, $innfeed_missing{$serv});
printf HTML (" %d %d%% ",
$innfeed_spooled{$serv},
$innfeed_accepted{$serv} / $innfeed_offered{$serv} * 100);
printf HTML (" %s \n";
printf HTML (" \n", $t);
print HTML " %s ",
"TOTAL");
printf HTML (" %d ", $innfeed_offered);
printf HTML (" %d %d ",
$innfeed_accepted, $innfeed_refused);
printf HTML (" %d %d ",
$innfeed_rejected, $innfeed_missing);
printf HTML (" %d %d%% ",
$innfeed_spooled,
$innfeed_accepted / $innfeed_offered * 100);
printf HTML (" %s \n
\n Server ";
print HTML " Offered ";
print HTML " Took Rejected ";
print HTML " Failed Accepted ";
print HTML " Elapsed ";
print HTML "\n";
}
$tt = 0;
foreach $serv (sort(keys (%nntplink_site)))
{
$tt += $nntplink_times{$serv};
$t = &second2time ($nntplink_times{$serv});
# Compute graph size..
$nb_max++;
$h_max = $nntplink_offered{$serv} if ($nntplink_offered{$serv} > $h_max);
if ($nntplink_offered{$serv} == 0)
{
printf ("%-25.25s %7d %7d %7d %7d %4d%% %9s\n",
$serv, $nntplink_offered{$serv},
$nntplink_accepted{$serv}, $nntplink_rejected{$serv},
$nntplink_failed{$serv}, 0, $t);
if ($HTML)
{
printf HTML (" \n");
}
}
else
{
printf ("%-25.25s %7d %7d %7d %7d %4d%% %9s\n",
$serv, $nntplink_offered{$serv},
$nntplink_accepted{$serv},
$nntplink_rejected{$serv}, $nntplink_failed{$serv},
$nntplink_accepted{$serv} / $nntplink_offered{$serv} * 100, $t);
if ($HTML)
{
printf HTML (" %s ",
$serv);
printf HTML (" %d ",
$nntplink_offered{$serv});
printf HTML (" %d ",
$nntplink_accepted{$serv});
printf HTML (" %d %d ",
$nntplink_rejected{$serv}, $nntplink_failed{$serv});
printf HTML (" %d%% %s ",
0, $t);
printf HTML (" \n");
}
}
$nntplink_offered += $nntplink_offered{$serv};
$nntplink_connect += $nntplink_connect{$serv};
$nntplink_accepted += $nntplink_accepted{$serv};
$nntplink_rejected += $nntplink_rejected{$serv};
$nntplink_failed += $nntplink_failed{$serv};
}
print "\n";
$t = &second2time ($tt);
printf ("%-25.25s %7d %7d %7d %7d %4d%% %9s\n",
"TOTAL", $nntplink_offered, $nntplink_accepted,
$nntplink_rejected, $nntplink_failed,
$nntplink_accepted / $nntplink_offered * 100, $t);
print "\n";
if ($HTML)
{
print HTML " %s ",
$serv);
printf HTML (" %d ",
$nntplink_offered{$serv});
printf HTML (" %d ",
$nntplink_accepted{$serv});
printf HTML (" %d %d ",
$nntplink_rejected{$serv}, $nntplink_failed{$serv});
printf HTML (" %d%% %s ",
$nntplink_accepted{$serv} / $nntplink_offered{$serv} *
100, $t);
printf HTML ("\n";
printf HTML (" \n",
$nntplink_accepted / $nntplink_offered * 100, $t);
print HTML " %s ",
"TOTAL");
printf HTML (" %d ",
$nntplink_offered);
printf HTML (" %d ",
$nntplink_accepted);
printf HTML (" %d %d ",
$nntplink_rejected, $nntplink_failed);
printf HTML (" %d%% %s \n
\n Server ";
print HTML " Connects ";
print HTML " Ok EOF ";
print HTML " Socket Select Load ";
print HTML " BPipe Space Exp ";
print HTML " Auth Other Pct ";
print HTML "\n";
}
$tt = 0;
foreach $serv (sort(keys (%nntplink_site)))
{
$errors = $nntplink_eof{$serv} + $nntplink_sockerr{$serv} +
$nntplink_selecterr{$serv} + $nntplink_hiload{$serv} +
$nntplink_bpipe{$serv} + $nntplink_nospace{$serv} +
$nntplink_auth{$serv} + $nntplink_expire{$serv} +
$nntplink_fail{$serv};
$ok = $nntplink_site{$serv} - $errors;
if ($nntplink_offered{$serv} == 0)
{
printf ("%-20.20s %4d %4d %3d %4d %4d %4d %4d %4d %4d %4d %4d %4d%%\n",
$serv, $nntplink_site{$serv}, $ok, $nntplink_eof{$serv},
$nntplink_sockerr{$serv}, $nntplink_selecterr{$serv},
$nntplink_hiload{$serv}, $nntplink_bpipe{$serv},
$nntplink_nospace{$serv}, $nntplink_expire{$serv},
$nntplink_auth{$serv}, $nntplink_fail{$serv}, 0);
if ($HTML)
{
printf HTML (" \n", 0);
}
}
else
{
printf ("%-20.20s %4d %4d %3d %4d %4d %4d %4d %4d %4d %4d %4d %4d%%\n",
$serv, $nntplink_site{$serv}, $ok, $nntplink_eof{$serv},
$nntplink_sockerr{$serv}, $nntplink_selecterr{$serv},
$nntplink_hiload{$serv}, $nntplink_bpipe{$serv},
$nntplink_nospace{$serv}, $nntplink_expire{$serv},
$nntplink_auth{$serv}, $nntplink_fail{$serv},
100.0 * $ok / $nntplink_site{$serv});
if ($HTML)
{
printf HTML (" %s ",
$serv);
printf HTML (" %s %d ",
$nntplink_site{$serv}, $ok);
printf HTML (" %d %d ",
$nntplink_eof{$serv}, $nntplink_sockerr{$serv});
printf HTML (" %d %d ",
$nntplink_selecterr{$serv}, $nntplink_hiload{$serv});
printf HTML (" %d %d ",
$nntplink_bpipe{$serv}, $nntplink_nospace{$serv});
printf HTML (" %d %d ",
$nntplink_expire{$serv}, $nntplink_auth{$serv});
printf HTML (" %d ", $nntplink_fail{$serv});
printf HTML (" %d%% \n",
100.0 * $ok / $nntplink_site{$serv});
}
}
$nntplink_site += $nntplink_site{$serv};
$ok_tot += $ok;
$nntplink_eof += $nntplink_eof{$serv};
$nntplink_sockerr += $nntplink_sockerr{$serv};
$nntplink_selecterr += $nntplink_selecterr{$serv};
$nntplink_hiload += $nntplink_hiload{$serv};
$nntplink_bpipe += $nntplink_bpipe{$serv};
$nntplink_nospace += $nntplink_nospace{$serv};
$nntplink_expire += $nntplink_expire{$serv};
$nntplink_auth += $nntplink_auth{$serv};
$nntplink_fail += $nntplink_fail{$serv};
}
print "\n";
printf ("%-20.20s %4d %4d %3d %4d %4d %4d %4d %4d %4d %4d %4d %4d%%\n",
"TOTAL", $nntplink_site, $ok_tot, $nntplink_eof,
$nntplink_sockerr, $nntplink_selecterr,
$nntplink_hiload, $nntplink_bpipe,
$nntplink_nospace, $nntplink_expire,
$nntplink_auth, $nntplink_fail,
100.0 * $ok_tot / $nntplink_site);
print "\n";
if ($HTML)
{
printf HTML (" %s ",
$serv);
printf HTML (" %s %d ",
$nntplink_site{$serv}, $ok);
printf HTML (" %d %d ",
$nntplink_eof{$serv}, $nntplink_sockerr{$serv});
printf HTML (" %d %d ",
$nntplink_selecterr{$serv}, $nntplink_hiload{$serv});
printf HTML (" %d %d ",
$nntplink_bpipe{$serv}, $nntplink_nospace{$serv});
printf HTML (" %d %d ",
$nntplink_expire{$serv}, $nntplink_auth{$serv});
printf HTML (" %d ", $nntplink_fail{$serv});
printf HTML (" %d%% \n",
100.0 * $ok_tot / $nntplink_site);
print HTML " %s ",
"TOTAL");
printf HTML (" %s %d ",
$nntplink_site, $ok_tot);
printf HTML (" %d %d ",
$nntplink_eof, $nntplink_sockerr);
printf HTML (" %d %d ",
$nntplink_selecterr, $nntplink_hiload);
printf HTML (" %d %d ",
$nntplink_bpipe, $nntplink_nospace);
printf HTML (" %d %d ",
$nntplink_expire, $nntplink_auth);
printf HTML (" %d ", $nntplink_fail);
printf HTML (" %d%% \n
\n System ";
print HTML " Offered Took ";
print HTML " Refused ";
print HTML " Rejected Accepted Elapsed ";
print HTML "\n";
}
$tt = 0;
foreach $serv (sort(keys (%innxmit_times)))
{
$tt += $innxmit_times{$serv};
$t = &second2time ($innxmit_times{$serv});
# Compute graph size..
$nb_max++;
$h_max = $innxmit_offered{$serv} if ($innxmit_offered{$serv} > $h_max);
if ($innxmit_offered{$serv} == 0)
{
printf ("%-25.25s %7d %7d %7d %7d %4d%% %9s\n",
$serv, $innxmit_offered{$serv},
$innxmit_accepted{$serv}, $innxmit_refused{$serv},
$innxmit_rejected{$serv}, 0, $t);
if ($HTML)
{
printf HTML (" \n", $t);
}
}
else
{
printf ("%-25.25s %7d %7d %7d %7d %4d%% %9s\n",
$serv, $innxmit_offered{$serv},
$innxmit_accepted{$serv}, $innxmit_refused{$serv},
$innxmit_rejected{$serv},
$innxmit_accepted{$serv} / $innxmit_offered{$serv} * 100, $t);
if ($HTML)
{
printf HTML (" %s %d ",
$serv, $innxmit_offered{$serv});
printf HTML (" %s %d ",
$innxmit_accepted{$serv}, $innxmit_refused{$serv});
printf HTML (" %d %d%% ",
$innxmit_rejected{$serv}, 0);
printf HTML (" %s \n", $t);
}
}
$innxmit_offered += $innxmit_offered{$serv};
$innxmit_accepted += $innxmit_accepted{$serv};
$innxmit_refused += $innxmit_refused{$serv};
$innxmit_rejected += $innxmit_rejected{$serv};
}
print "\n";
$t = &second2time ($tt);
$offrd = $innxmit_accepted + $innxmit_refused + $innxmit_rejected;
printf ("%-25.25s %7d %7d %7d %7d %4d%% %9s\n",
"TOTAL", $innxmit_offered,
$innxmit_accepted, $innxmit_refused, $innxmit_rejected,
$innxmit_accepted / $innxmit_offered * 100, $t);
print "\n";
if ($HTML)
{
print HTML " %s %d ",
$serv, $innxmit_offered{$serv});
printf HTML (" %s %d ",
$innxmit_accepted{$serv}, $innxmit_refused{$serv});
printf HTML (" %d %d%% ",
$innxmit_rejected{$serv}, 100 *
$innxmit_accepted{$serv} / $innxmit_offered{$serv});
printf HTML (" %s \n";
printf HTML (" \n", $t);
print HTML " %s %d ",
"TOTAL", $innxmit_offered);
printf HTML (" %d %d ",
$innxmit_accepted, $innxmit_refused);
printf HTML (" %d %d%% ",
$innxmit_rejected,
$innxmit_accepted / $innxmit_offered * 100);
printf HTML (" %s \n
\n Server ";
print HTML " Connects ";
print HTML " Ok Auth Load Space ";
print HTML " Expire Connect ";
print HTML " Other Pct ";
print HTML "\n";
}
$tt = 0;
foreach $serv (sort(keys (%innxmit_site)))
{
$errors = $innxmit_afail_host{$serv} + $innxmit_hiload{$serv} +
$innxmit_nospace{$serv} + $innxmit_cfail_host{$serv} +
$innxmit_expire{$serv} + $innxmit_crefused{$serv};
$ok = $innxmit_site{$serv} - $errors;
if ($innxmit_site{$serv} == 0)
{
printf ("%-25.25s %4d %4d %4d %4d %5d %5d %5d %5d %4d%%\n",
$serv, $innxmit_site{$serv}, $ok, $innxmit_afail_host{$serv},
$innxmit_hiload{$serv}, $innxmit_nospace{$serv},
$innxmit_expire{$serv}, $innxmit_cfail_host{$serv},
$innxmit_crefused{$serv}, 0);
if ($HTML)
{
printf HTML (" \n", 0);
}
}
else
{
printf ("%-25.25s %4d %4d %4d %4d %5d %5d %5d %5d %4d%%\n",
$serv, $innxmit_site{$serv}, $ok, $innxmit_afail_host{$serv},
$innxmit_hiload{$serv}, $innxmit_nospace{$serv},
$innxmit_expire{$serv}, $innxmit_cfail_host{$serv},
$innxmit_crefused{$serv}, 100.0 * $ok / $innxmit_site{$serv});
if ($HTML)
{
printf HTML (" %s ",
$serv);
printf HTML (" %s %d ",
$innxmit_site{$serv}, $ok);
printf HTML (" %d %d ",
$innxmit_afail_host{$serv}, $innxmit_hiload{$serv});
printf HTML (" %d %d ",
$innxmit_nospace{$serv}, $innxmit_expire{$serv});
printf HTML (" %d ",
$innxmit_cfail_host{$serv});
printf HTML (" %d ",
$innxmit_crefused{$serv});
printf HTML (" %d%% \n",
100.0 * $ok / $innxmit_site{$serv});
}
}
$innxmit_site += $innxmit_site{$serv};
$ok_tot += $ok;
$innxmit_hiload += $innxmit_hiload{$serv};
$innxmit_nospace += $innxmit_nospace{$serv};
$innxmit_expire += $innxmit_expire{$serv};
$innxmit_auth += $innxmit_auth{$serv};
$innxmit_crefused += $innxmit_crefused{$serv};
$innxmit_afail_host += $innxmit_afail_host{$serv};
$innxmit_cfail_host += $innxmit_cfail_host{$serv};
}
print "\n";
printf ("%-25.25s %4d %4d %4d %4d %5d %5d %5d %5d %4d%%\n",
"TOTAL", $innxmit_site, $ok_tot, $innxmit_afail_host,
$innxmit_hiload, $innxmit_nospace,
$innxmit_expire, $innxmit_cfail_host,
$innxmit_crefused, 100.0 * $ok_tot / $innxmit_site);
print "\n";
if ($HTML)
{
printf HTML (" %s ",
$serv);
printf HTML (" %s %d ",
$innxmit_site{$serv}, $ok);
printf HTML (" %d %d ",
$innxmit_afail_host{$serv}, $innxmit_hiload{$serv});
printf HTML (" %d %d ",
$innxmit_nospace{$serv}, $innxmit_expire{$serv});
printf HTML (" %d ",
$innxmit_cfail_host{$serv});
printf HTML (" %d ",
$innxmit_crefused{$serv});
printf HTML (" %d%% \n",
100.0 * $ok_tot / $innxmit_site);
print HTML " %s ",
"TOTAL");
printf HTML (" %s %d ",
$innxmit_site, $ok_tot);
printf HTML (" %d %d ",
$innxmit_afail_host, $innxmit_hiload);
printf HTML (" %d %d ",
$innxmit_nospace, $innxmit_expire);
printf HTML (" %d ",
$innxmit_cfail_host);
printf HTML (" %d ",
$innxmit_crefused);
printf HTML (" %d%% \n
\n System ";
print HTML " Offered Articles ";
print HTML " Bytes ";
print HTML " Elapsed ";
print HTML "\n";
}
$tt = 0;
foreach $serv (sort(keys (%batcher_elapsed)))
{
$tt += $batcher_elapsed{$serv};
$t = &second2time ($batcher_elapsed{$serv});
if ($batcher_offered{$serv} == 0)
{
printf ("%-25.25s %7d %8d %10d %9s\n",
$serv, $batcher_offered{$serv},
$batcher_articles{$serv}, $batcher_bytes{$serv}, $t);
if ($HTML)
{
printf HTML (" \n", $t);
}
}
else
{
printf ("%-25.25s %7d %8d %10d %9s\n",
$serv, $batcher_offered{$serv},
$batcher_articles{$serv}, $batcher_bytes{$serv}, $t);
if ($HTML)
{
printf HTML (" %s %d ",
$serv, $batcher_offered{$serv});
printf HTML (" %s %d ",
$batcher_articles{$serv}, $batcher_bytes{$serv});
printf HTML (" %s \n", $t);
}
}
$batcher_offered += $batcher_offered{$serv};
$batcher_articles += $batcher_articles{$serv};
$batcher_bytes += $batcher_bytes{$serv};
$batcher_elapsed += $batcher_elapsed{$serv};
}
print "\n";
$t = &second2time ($tt);
printf ("%-25.25s %7d %8d %10d %9s\n",
"TOTAL", $batcher_offered,
$batcher_articles, $batcher_bytes, $t);
print "\n";
if ($HTML)
{
print HTML " %s %d ",
$serv, $batcher_offered{$serv});
printf HTML (" %s %d ",
$batcher_articles{$serv}, $batcher_bytes{$serv});
printf HTML (" %s \n";
printf HTML (" \n", $t);
print HTML " %s %d ",
"TOTAL", $batcher_offered);
printf HTML (" %d %d ",
$batcher_articles, $batcher_bytes);
printf HTML (" %s \n
\n System ";
print HTML " Offered ";
print HTML "\n";
}
foreach $serv (sort(keys (%rnews_host)))
{
printf ("%-25.25s %7d\n", $serv, $rnews_host{$serv});
if ($HTML)
{
printf HTML (" \n",
$serv, $rnews_host{$serv});
}
$rnews_host += $rnews_host{$serv};
}
print "\n";
printf ("%-25.25s %7d\n",
"TOTAL", $rnews_host);
print "\n";
if ($HTML)
{
print HTML " %s %d \n";
printf HTML (" \n",
"TOTAL", $rnews_host);
print HTML " %s %d \n
\n Reason ";
print HTML " Connections ";
print HTML "\n";
}
foreach $serv (sort(keys (%rnews_rejected)))
{
printf ("%-30.30s %7d\n", $serv, $rnews_rejected{$serv});
if ($HTML)
{
printf HTML (" \n",
$serv, $rnews_rejected{$serv});
}
$rnews_rejected += $rnews_rejected{$serv};
}
print "\n";
printf ("%-30.30s %7d\n",
"TOTAL", $rnews_rejected);
print "\n";
if ($HTML)
{
print HTML " %s %d \n";
printf HTML (" \n",
"TOTAL", $rnews_rejected);
print HTML " %s %d \n
\n Reason ";
print HTML " Element Number ";
print HTML "\n";
}
if (%rnews_bogus_ng)
{
print "Unwanted newsgroups\n";
print HTML " \n" if ($HTML);
foreach $ng (sort(keys (%rnews_bogus_ng)))
{
printf ("%-27.27s %-20.20s %5d\n", " --", $ng, $rnews_bogus_ng{$ng});
if ($HTML)
{
printf HTML (" Unwanted newsgroups \n",
$ng, $rnews_bogus_ng{$ng});
}
$rnews_bogus += $rnews_bogus_ng{$ng};
}
}
if (%rnews_bogus_dist)
{
print "Unwanted distributions\n";
print HTML " %s %d \n" if ($HTML);
foreach $dist (sort(keys (%rnews_bogus_dist)))
{
printf ("%-27.27s %-20.20s %5d\n", " --", $dist, $rnews_bogus_dist{$dist});
if ($HTML)
{
printf HTML (" Unwanted distributions \n",
$dist, $rnews_bogus_dist{$dist});
}
$rnews_bogus += $rnews_bogus_dist{$dist};
}
}
if (%rnews_bogus_date)
{
print "Bad Date\n";
print HTML " %s %d \n" if ($HTML);
foreach $date (sort(keys (%rnews_bogus_date)))
{
printf ("%-27.27s %-20.20s %5d\n", " --", $date, $rnews_bogus_date{$date});
if ($HTML)
{
printf HTML (" Bad Date \n",
$date, $rnews_bogus_date{$date});
}
$rnews_bogus += $rnews_bogus_date{$date};
}
}
printf ("\n%-27.27s %-20.20s %5d\n", "TOTAL", "--", $rnews_bogus);
printf HTML (" %s %d \n",
"TOTAL", "", $rnews_bogus);
print "\n";
print HTML " %-27.27s %-20.20s %5d \n
\n System ";
print HTML " Connections Articles ";
print HTML " Groups ";
print HTML " Posted Rejected Elapsed ";
print HTML "\n";
}
$tt = 0;
foreach $serv (sort(keys (%nnrpd_groups)))
{
$reader++;
if (($nnrpd_groups{$serv} != 0) || ($nnrpd_post_ok{$serv} != 0))
{
$tt += $nnrpd_times{$serv};
$t = &second2time ($nnrpd_times{$serv});
printf ("%-38.38s %4d %6d %6d %4d %4d %9s\n",
$serv, $nnrpd_connect{$serv}, $nnrpd_articles{$serv},
$nnrpd_groups{$serv}, $nnrpd_post_ok{$serv},
$nnrpd_post_rej{$serv}, $t);
if ($HTML)
{
printf HTML (" \n", $t);
}
$nnrpd_connect += $nnrpd_connect{$serv};
$nnrpd_articles += $nnrpd_articles{$serv};
$nnrpd_groups += $nnrpd_groups{$serv};
$nnrpd_post_ok += $nnrpd_post_ok{$serv};
$nnrpd_post_rej += $nnrpd_post_rej{$serv};
}
}
print "\n";
$t = &second2time ($tt);
printf ("%-38.38s %4d %6d %6d %4d %4d %9s\n",
"TOTAL : $reader", $nnrpd_connect, $nnrpd_articles,
$nnrpd_groups, $nnrpd_post_ok,
$nnrpd_post_rej, $t);
print "\n";
if ($HTML)
{
print HTML " %s %d ",
$serv, $nnrpd_connect{$serv});
printf HTML (" %s %d ",
$nnrpd_articles{$serv}, $nnrpd_groups{$serv});
printf HTML (" %d %d ",
$nnrpd_post_ok{$serv}, $nnrpd_post_rej{$serv});
printf HTML (" %s \n";
printf HTML (" \n", $t);
print HTML " %s %d ",
"TOTAL : $reader", $nnrpd_connect);
printf HTML (" %d %d ",
$nnrpd_articles, $nnrpd_groups);
printf HTML (" %d %d ",
$nnrpd_post_ok, $nnrpd_post_rej);
printf HTML (" %s \n
\n System ";
print HTML " Connections ";
print HTML "\n";
}
foreach $serv (sort(keys (%nnrpd_groups)))
{
if (($nnrpd_groups{$serv} == 0) && ($nnrpd_post_ok{$serv} == 0))
{
printf ("%-64.64s %5d\n",
$serv, $nnrpd_connect{$serv});
if ($HTML)
{
printf HTML (" \n",
$serv, $nnrpd_connect{$serv});
}
}
}
print "\n";
print HTML " %s %d \n
\n System ";
print HTML " Connections ";
print HTML "\n";
}
foreach $client (sort {$nnrpd_no_permission{$b} <=> $nnrpd_no_permission{$a}}
(keys (%nnrpd_no_permission)))
{
printf ("%-64.64s %5d\n",
$client, $nnrpd_no_permission{$client});
if ($HTML)
{
printf HTML (" \n",
$client, $nnrpd_no_permission{$client});
}
}
print "\n";
print HTML " %s %d \n
\n IP ";
print HTML " Connections ";
print HTML "\n";
}
foreach $ip (sort(keys (%nnrpd_gethostbyaddr)))
{
printf ("%-64.64s %5d\n",
$ip, $nnrpd_gethostbyaddr{$ip});
if ($HTML)
{
printf HTML (" \n",
$ip, $nnrpd_gethostbyaddr{$ip});
}
}
print "\n";
print HTML " %s %d \n
\n System ";
print HTML " Commands ";
print HTML "\n";
}
foreach $client (sort(keys (%nnrpd_unrecognized)))
{
printf ("%-64.64s %5d\n",
$client, $nnrpd_unrecognized{$client});
if ($HTML)
{
printf HTML (" \n",
$client, $nnrpd_unrecognized{$client});
}
}
print "\n";
print HTML " %s %d \n
\n Commands ";
print HTML " Hits ";
print HTML "\n";
}
foreach $cmd (sort(keys (%nnrpd_unrecogn_cmd)))
{
printf ("%-40.40s %5d\n",
$cmd, $nnrpd_unrecogn_cmd{$cmd});
if ($HTML)
{
printf HTML (" \n",
$cmd, $nnrpd_unrecogn_cmd{$cmd});
}
}
print "\n";
print HTML " %s %d \n
\n System ";
print HTML " Timeouts Reset by Peer ";
print HTML "\n";
}
foreach $client (sort(keys (%nnrpd_timeout)))
{
$t_o += $nnrpd_timeout{$client};
$t_p += $nnrpd_reset_peer{$client};
$t_c++;
printf ("%-64.64s %5d %5d\n",
$client, $nnrpd_timeout{$client}, $nnrpd_reset_peer{$client});
if ($HTML)
{
printf HTML (" \n",
$nnrpd_reset_peer{$client});
}
}
print "\n";
printf ("%-64.64s %5d %5d\n", "TOTAL : $t_c", $t_o, $t_p);
print "\n";
if ($HTML)
{
print HTML " %s %d ",
$client, $nnrpd_timeout{$client});
printf HTML (" %d \n";
printf HTML (" \n", $t_p);
print HTML " %s %d ",
"TOTAL : $t_c", $t_o);
printf HTML (" %d \n
\n Category ";
print HTML " Hits ";
print HTML "\n";
}
foreach $hierarchy (sort {$nnrpd_hierarchy{$b} <=> $nnrpd_hierarchy{$a}}
(keys (%nnrpd_hierarchy)))
{
printf ("%-40.40s %5d\n",
$hierarchy, $nnrpd_hierarchy{$hierarchy});
if ($HTML)
{
printf HTML (" \n",
$hierarchy, $nnrpd_hierarchy{$hierarchy});
}
$max += $nnrpd_hierarchy{$hierarchy};
}
print "\n";
if (($HTML) && ($GRAPH))
{
# Draw graph...
$marginx = 20;
$marginy = 30;
$image = new GD::Image($xmax, $ymax);
$white = $image->colorAllocate (255, 255, 255);
$black = $image->colorAllocate ( 0, 0, 0);
$color1[0] = $image->colorAllocate (255, 0, 255);
$color2[0] = $image->colorAllocate (200, 0, 200);
$color1[1] = $image->colorAllocate (255, 0, 0);
$color2[1] = $image->colorAllocate (200, 0, 0);
$color1[2] = $image->colorAllocate (255, 255, 0);
$color2[2] = $image->colorAllocate (200, 200, 0);
$color1[3] = $image->colorAllocate ( 0, 0, 255);
$color2[3] = $image->colorAllocate ( 0, 0, 200);
$color1[4] = $image->colorAllocate ( 0, 255, 0);
$color2[4] = $image->colorAllocate ( 0, 200, 0);
$image->transparent ($white);
$a = 270;
$x = 300;
$y = 200;
$col = 0;
$image->arc ($xmax / 2, $ymax /2, $x, $y, 0, 360, $black);
$image->fill ($xmax / 2, $ymax / 2, $color1[$col]);
$image->arc ($xmax / 2, $ymax / 2 + 30, $x, $y, 0, 180, $black);
$image->line ($xmax / 2 - $x / 2, $ymax / 2, $xmax / 2 - $x / 2,
$ymax / 2 + 30, $black);
$image->line ($xmax / 2 + $x / 2, $ymax / 2, $xmax / 2 + $x / 2,
$ymax / 2 + 30, $black);
$image->fill ($xmax / 2, $ymax /2 + 25 + $y / 2, $color2[$col]);
$col++;
foreach $hierarchy (sort {$nnrpd_hierarchy{$b} <=> $nnrpd_hierarchy{$a}}
(keys (%nnrpd_hierarchy)))
{
$angle = $nnrpd_hierarchy{$hierarchy} / $max * 360;
if ($angle > 10)
{
$image->line ($xmax / 2, $ymax /2,
$xmax / 2 - $x / 2 * sin ($a / 180 * 3.14),
$ymax / 2 - $y / 2 * cos ($a / 180 * 3.14), $black);
$image->line ($xmax / 2, $ymax /2,
$xmax / 2 - $x / 2 * sin (($a + $angle) / 180 * 3.14),
$ymax / 2 - $y / 2 * cos (($a + $angle) / 180 * 3.14),
$black);
$image->fill ($xmax / 2 -
$x / 4 * sin (($a + $angle / 2) / 180 * 3.14),
$ymax / 2 -
$y / 4 * cos (($a + $angle / 2 ) / 180 * 3.14),
$color1[$col]);
$image->line ($xmax / 2 - $x / 2 * sin (($a + $angle) / 180 * 3.14),
$ymax / 2 - $y / 2 * cos (($a + $angle) / 180 * 3.14),
$xmax / 2 - $x / 2 * sin (($a + $angle) / 180 * 3.14),
$ymax / 2 - $y / 2 * cos (($a + $angle) / 180 * 3.14) + 30,
$black) unless (($a + $angle> 270) && ($a + $angle < 450));
$image->fill ($xmax / 2 -
$x / 2 * sin (($a + $angle - 4) / 180 * 3.14),
$ymax / 2 -
$y / 2 * cos (($a + $angle - 4) / 180 * 3.14) + 15,
$color2[$col])
unless (($a + $angle> 270) && ($a + $angle < 450));
$image->string (gdSmallFont,
$xmax / 2 - $x * 0.67 * sin (($a + $angle / 2) / 180 * 3.14),
$ymax / 2 - $y * 0.67 * cos (($a + $angle / 2) / 180 * 3.14),
"$hierarchy", $black);
}
else
{
$old_a = $a unless ($old_a);
}
$a += $angle;
$col++;
$col = 1 if ($col == 5);
}
if ($old_a)
{
$angle = $a + $angle - $old_a;
$a = $old_a;
$image->string (gdSmallFont,
$xmax / 2 - $x * 0.6 * sin (($a + $angle / 2) / 180 * 3.14),
$ymax / 2 - $y * 0.6 * cos (($a + $angle / 2) / 180 * 3.14),
"others", $black);
}
$image->rectangle (0, 0, $xmax - 1, $ymax - 1, $black);
$image->string (gdSmallFont, 5, 5,
"Newsgroup request counts (by category)", $black);
print HTML " %s %d \n
\n Newsgroup ";
print HTML " Hits ";
print HTML "\n";
}
foreach $group (sort {$nnrpd_group{$b} <=> $nnrpd_group{$a}}
(keys (%nnrpd_group)))
{
$total_grp++;
$total_acc += $nnrpd_group{$group};
if (($total_grp < $NGMAX) || ($NGMAX == -1))
{
printf ("%-40.40s %5d\n",
$group, $nnrpd_group{$group});
if ($HTML)
{
printf HTML (" \n",
$group, $nnrpd_group{$group});
}
}
}
print "(...)\n" if (($total_grp > $NGMAX) && ($NGMAX != -1));
print "\n";
printf ("%-40.40s %5d\n",
"TOTAL : $total_grp", $total_acc);
if ($HTML)
{
printf HTML (" %s %d \n",
"TOTAL : $total_grp", $total_acc);
}
print HTML " %s %d
\n" if ($HTML);
}
if ($HTML)
{
print HTML "\ninnreport";
print HTML " $version -- ";
print HTML "Report bugs to ";
print HTML "tassin\@eerie.fr.\n\n\n";
close (HTML);
}
if ($ARCHIVE)
{
&rotate ($CYCLE, "$HTML_dir", "news-notice", ".html");
&rotate ($CYCLE, "$IMG_dir", "innd", ".gif");
&rotate ($CYCLE, "$IMG_dir", "innfeed", ".gif");
&rotate ($CYCLE, "$IMG_dir", "nntplink", ".gif");
&rotate ($CYCLE, "$IMG_dir", "innxmit", ".gif");
&rotate ($CYCLE, "$IMG_dir", "hierarchy", ".gif");
&make_index ("$HTML_dir", "$index");
}
################
# End of report.
###################################################################
######
# Misc...
# Convert : seconds to hh:mm:ss
sub second2time
{
local ($temp);
local ($t);
($t) = @_;
# Hours
$temp = sprintf ("%02d", $t / 3600);
$chaine = "$temp:";
$t %= 3600;
# Min
$temp = sprintf ("%02d", $t / 60);
$chaine .= "$temp:";
$t %= 60;
# Sec
$chaine .= sprintf ("%02d", $t);
return ($chaine);
}
# Rotate the archive files..
sub rotate
{
# Usage : &rotate ($max_files, "$directory", "prefix", "suffix");
local ($max, $rep, $prefix, $suffix) = @_;
local ($file, $num, $a, $b, %files);
return 1 unless ($max);
opendir (DIR, "$rep") || die "Cant open directory \"$rep\"\n";
FILE : while ($file = readdir (DIR))
{
next FILE
unless ($file =~ /^$prefix\.\d\d\.\d\d\.\d\d\-\d\d:\d\d:\d\d$suffix$/);
$files{$file}++;
}
closedir (DIR);
$num = 0;
foreach $file (sort {$b cmp $a} (keys (%files)))
{
unlink ("$rep/$file") if (($num++ >= $max) && (-f "$rep/$file"));
}
return 1;
}
# convert a date to a number of seconds
sub convdate
{
# usage : $num = &convdate ($date);
# date format is Aug 22 01:49:40
local ($T) = @_;
local ($m, $d, $h, $mn, $s) = $T =~ /^(\S+)\s+(\d+)\s+(\d+):(\d+):(\d+)$/;
local ($out);
$out = $s + 60 * $mn + 3600 * $h + 86400 * $d;
$m = index ("JanFebMarAprMayJunJulAugSepOctNovDec", $m) / 3 + 1;
$out += $m * 31 * 86400;
return ($out);
}
# make an index for archive pages
sub make_index
{
# Usage : &make_index ("$HTML_dir", "$index");
local ($rep, $name) = @_;
local ($d);
open (INDEX, "> $rep/$name") || die "Unable to create $rep/$name\n";
print INDEX "\n
\n";
print INDEX "
\n";
print INDEX "\n";
print INDEX "
\n";
print INDEX "\n";
opendir (DIR, "$rep") || die "Cant open directory \"$rep\"\n";
File : while ($file = readdir (DIR))
{
next File
unless ($file =~ /^news-notice\.\d\d\.\d\d\.\d\d\-\d\d:\d\d:\d\d\.html$/);
$files{$file}++;
}
closedir (DIR);
$num = 0;
$maxy = 0;
$max = 0;
$min = 126144000000; # 4000 years !!
foreach $file (sort {$b cmp $a} (keys (%files)))
{
open (FILE, "$rep/$file") || next;
$n = 0;
$line =
(.*)<\/H3>$/) && !(eof (FILE)))
{
$line =
(.*)<\/H3>$/;
while (($line !~ /^$/) && !(eof (FILE)))
{
$line =
TOTAL <\/TH>/) && !(eof (FILE)))
{
$line =
innreport";
print INDEX " $version -- ";
print INDEX "Report bugs to ";
print INDEX "tassin\@eerie.fr.\n\n\n";
close (INDEX);
if ($GRAPH)
{
# Draw graph...
$xmax = 400;
$ymax = 250;
$marginx = 30;
$marginy = 40;
$yratio = ($ymax - 2 * $marginy) / $maxy;
$xratio = ($xmax - 2 * $marginx) / ($max - $min);
$image = new GD::Image($xmax, $ymax);
$white = $image->colorAllocate (255, 255, 255);
$black = $image->colorAllocate ( 0, 0, 0);
$red = $image->colorAllocate (255, 0, 0);
$blue = $image->colorAllocate ( 0, 0, 255);
$image->transparent ($white);
foreach $key (keys (%g_n))
{
$image->filledRectangle ($marginx + ($key - $min) * $xratio,
$ymax - $marginy - $g_n{$key} / $g_d{$key} * $yratio,
$marginx + ($key + $g_d{$key} - $min) * $xratio,
$ymax - $marginy, $red);
$image->rectangle ($marginx + ($key - $min) * $xratio,
$ymax - $marginy - $g_n{$key} / $g_d{$key} * $yratio,
$marginx + ($key + $g_d{$key} - $min) * $xratio,
$ymax - $marginy, $black)
unless ($g_d{$key} * $xratio < 2);
}
# Axes..
$image->line ($marginx, $marginy - 15, $marginx, $ymax - $marginy, $black);
$image->line ($marginx, $ymax - $marginy , $xmax - $marginx + 15,
$ymax - $marginy, $black);
$image->line ($xmax - $marginx, $ymax - $marginy, $xmax - $marginx,
$ymax - $marginy + 5, $black);
$image->string (gdSmallFont, $xmax - $marginx - 1.5 * gdSmallFont->width,
$ymax - $marginy + 10, "Now", $black);
$arts = sprintf ("%d", $maxy * 60);
$image->line ($marginx - 5, $ymax - $marginy - $arts * $yratio / 60,
$marginx,
$ymax - $marginy - $arts * $yratio / 60, $black);
$image->line ($marginx - 5, $ymax - $marginy, $marginx,
$ymax - $marginy, $black);
$image->string (gdSmallFont, 5, $ymax - $marginy, "0", $black);
$image->string (gdSmallFont, 5, $ymax - $marginy - $arts * $yratio / 60,
"$arts", $black);
$days = sprintf ("%d days", ($max - $min) / 86400);
$day = sprintf ("%d", ($max - $min) / 86400);
$abs = $max - $day * 86400;
$image->line ($marginx + ($abs - $min) * $xratio, $ymax - $marginy,
$marginx + ($abs - $min) * $xratio, $ymax - $marginy + 5,
$black);
$image->string (gdSmallFont, $marginx + ($abs - $min) * $xratio
- 3 * gdSmallFont->width,
$ymax - $marginy + 10, "$days", $black);
$image->rectangle (0, 0, $xmax - 1, $ymax - 1, $black);
$image->string (gdSmallFont, ($xmax - 27 * gdSmallFont->width) / 2,
$ymax - 5 - gdSmallFont->height,
"Articles received (art/min)", $black);
open (IMG, "> $IMG_dir/received.gif") || die "Can't create img\n";
print IMG $image->gif;
close (IMG);
}
return 1;
}
######################### End of File ##########################