]> git.ipfire.org Git - thirdparty/AWStats.git/commitdiff
Added a Worms report.
authoreldy <>
Wed, 26 Nov 2003 18:01:53 +0000 (18:01 +0000)
committereldy <>
Wed, 26 Nov 2003 18:01:53 +0000 (18:01 +0000)
docs/awstats_changelog.txt
docs/awstats_config.html
docs/awstats_setup.html
wwwroot/cgi-bin/awstats.model.conf
wwwroot/cgi-bin/awstats.pl
wwwroot/cgi-bin/lang/awstats-en.txt
wwwroot/cgi-bin/lang/awstats-fr.txt

index 40e67c448796f3af70358e224652374e199ccfed..81e86f95003aebc81f7568b1834892e3df22bda1 100644 (file)
@@ -23,16 +23,22 @@ Fixes:
 - Other minor bugs (814970,823064,823323,831438,836315).
 - Fixed bug in counting hits for miscellanous and clusters chart when
   a temporary flush was done on disk during a long update.
-- ExtraSections now works on all records whatever is the error code.
+- ExtraSections now works on all records whatever is the status code.
 - Click on "Summary" now returns to top of page even with rawlog plugin.
+- Fix in log parsing that should reduce dropped records to only records
+  that match a dropping criteria (SkipFiles, Skip..., Only...).
 
 New features/improvements:
 - Increased speed by 10 to 20%.
-- A lot of portion of codes have been rewritten to make code more easy to
-  understand and reduce unknown bugs.
+- Added a Worms report.
+- Added report for "not viewed" traffic in Summary report.
+- Monthly history report have been taken out the Summary report.
 - Some changes to make AWStats to be XML compliant ready.
   Need to set the new parameter BuildReportFormat to 'xml' in config file.
-- Summary report shows also "unviewed" traffic.
+  Added also the BuildHistoryFormat parameter (Even if only 'text' is
+  supported for the moment).
+- A lot of part of codes have been rewritten to make code more easy to
+  understand and reduce unknown bugs.
 - A new search engine database to allow several "match id" for same
   search engine. Example: All google ip referer id are recognised.
 - Can use UA and HOST fields to build personalized ExtraSection reports.
index dfdc01db21b8a8f9bcccb16ab7d079bdfe1e19f5..68c0fbbc3a086490d1162961a7aa3360eabc39e0 100644 (file)
@@ -134,6 +134,7 @@ when reading it), follow the example:<br>
 <li><a href="#Show">ShowHostsStats</a>
 <li><a href="#Show">ShowAuthenticatedUsers</a>
 <li><a href="#Show">ShowRobotsStats</a>
+<li><a href="#Show">ShowWormsStats</a>
 <li><a href="#Show">ShowSessionsStats</a>
 <li><a href="#Show">ShowPagesStats</a>
 <li><a href="#Show">ShowCompressionStats</a>
@@ -1281,6 +1282,7 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors
 5.5+ for ShowDaysOfMonthStats<br>
 5.6+ for ShowMiscStats,ShowSTMPErrorsStats<br>
 5.8+ for ShowClusterStats<br>
+6.0+ for ShowWormsStats<br>
 <br># You choose here which reports you want to see in the main page and what you
 <br># want to see in those reports.
 <br># Possible values:
@@ -1326,6 +1328,9 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors
 <br># Show robots chart
 <br># Default: HBL, Possible codes: HBL
 <br>ShowRobotsStats=HBL
+<br># Show worms chart\r
+<br># Default: HBL, Possible codes: HBL\r
+<br>ShowWormsStats=HBL\r
 <br># Show email senders chart (For use when analyzing mail log files)
 <br># Default: 0, Possible codes: HBML
 <br>ShowEMailSenders=0
@@ -1456,7 +1461,7 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors
 <br># List of visible flags with link to other language translations.
 <br># See Lang parameter for list of allowed flag/language codes.
 <br># If you don't want any flag link, set ShowFlagLinks to "".
-<br># This parameter is used only if ShowHeader parameter is set to 1.
+<br># This parameter is used only if ShowMenu parameter is set to 1.
 <br># Possible values: "" or "language_codes_separated_by_space"
 <br># Default: "en es fr it nl es"
 <br>#
index 7911b252cc832080c766697ba66b41ed314694e4..6d99d02c783efe27a129f624b8a871979072717c 100644 (file)
@@ -41,7 +41,7 @@ AWStats common use is made in 3 steps:<br>
 </ul>
 <br>
 
-<br><a name="INSTALL"><H2 style="font: 22px arial,helvetica,sanserif color: #606060"><u>Step 1 : Install and Setup</u></H2></a>
+<br><a name="INSTALL"><H2 style="font: 22px arial,helvetica,sanserif color: #606060"><u>Step 1 : Install and Setup with configure.pl</u></H2></a>
 
 <br>
 <a name="INSTALLAPACHE"><b>A) With Apache or compatible server (on Unix/Linux, Windows, MacOS...)</b></a><br>
index 9545872d12aebeb8acca8149f26842ec034cf529..0d328b64abadc4953d00bb145107c20058c69b4b 100644 (file)
@@ -239,7 +239,7 @@ AllowToUpdateStatsFromBrowser=0
 # for web hosting providers that offer AWStats for large sites, on shared
 # servers, to non CPU cautious customers.
 # For this reason, the 'full year' is only enabled on Command Line by default.
-# You can change this by setting this parameter to 0, 1 (recommanded), 2 or 3.
+# You can change this by setting this parameter to 0, 1, 2 or 3.
 # Possible values:
 #  0 - Never allowed
 #  1 - Allowed on CLI only, -Year- value in combo is not visible
@@ -792,7 +792,7 @@ LevelForFileTypesDetection=2                        # 0 disables File types detection.
 # Frames are only available for report viewed dynamically. When you build
 # pages from command line, this option is not used and no frames are built.
 # Possible values: 0 or 1
-# Default: 0
+# Default: 1
 #
 UseFramesWhenCGI=1
 
@@ -893,6 +893,9 @@ ShowAuthenticatedUsers=0
 # Show robots chart
 # Default: HBL, Possible codes: HBL
 ShowRobotsStats=HBL
+# Show worms chart\r
+# Default: HBL, Possible codes: HBL\r
+ShowWormsStats=HBL\r
 # Show email senders chart (For use when analyzing mail log files)
 # Default: 0, Possible codes: HBML
 ShowEMailSenders=0
@@ -1012,7 +1015,7 @@ FirstDayOfWeek=1
 # List of visible flags that links to other language translations.
 # See Lang parameter for list of allowed flag/language codes.
 # If you don't want any flag link, set ShowFlagLinks to "".
-# This parameter is used only if ShowHeader parameter is set to 1.
+# This parameter is used only if ShowMenu parameter is set to 1.
 # Possible values: "" or "language_codes_separated_by_space"
 # Example: "en es fr nl es"
 # Default: ""
index c089b4d0ec000cd33a07e015c1ed974837d6ccbd..d60f9f0af6dcdd74a698c8dc2ca5667888ac5cd1 100644 (file)
@@ -491,7 +491,9 @@ use vars qw/ @Message /;
 'Not viewed trafic is trafic generated by robots, worms or answers with special HTTP status code',
 'Traffic viewed',
 'Traffic not viewed',
-'Monthly history'
+'Monthly history',
+'Worms',
+'different worms'
 );
 
 
@@ -1530,7 +1532,7 @@ sub Check_Config {
        if ($ShowHostsStats !~ /[01PHBL]/)              { $ShowHostsStats='PHBL'; }
        if ($ShowAuthenticatedUsers !~ /[01PHBL]/)      { $ShowAuthenticatedUsers=0; }
        if ($ShowRobotsStats !~ /[01HBL]/)              { $ShowRobotsStats='HBL'; }
-       if ($ShowWormsStats !~ /[01HL]/)                { $ShowWormsStats='HL'; }
+       if ($ShowWormsStats !~ /[01HBL]/)               { $ShowWormsStats='HBL'; }
        if ($ShowEMailSenders !~ /[01HBML]/)                    { $ShowEMailSenders=0; }
        if ($ShowEMailReceivers !~ /[01HBML]/)          { $ShowEMailReceivers=0; }
        if ($ShowSessionsStats !~ /[01]/)               { $ShowSessionsStats=1; }
@@ -1605,7 +1607,7 @@ sub Check_Config {
        if ($ShowEMailReceivers eq '1')     { $ShowEMailReceivers = 'HBML'; }
        if ($ShowAuthenticatedUsers eq '1') { $ShowAuthenticatedUsers = 'PHBL'; }
        if ($ShowRobotsStats eq '1')            { $ShowRobotsStats = 'HBL'; }
-       if ($ShowWormsStats eq '1')             { $ShowWormsStats = 'HL'; }
+       if ($ShowWormsStats eq '1')             { $ShowWormsStats = 'HBL'; }
        if ($ShowPagesStats eq '1')             { $ShowPagesStats = 'PBEX'; }
        if ($ShowFileTypesStats eq '1')         { $ShowFileTypesStats = 'HB'; }
        if ($ShowOriginStats eq '1')            { $ShowOriginStats = 'PH'; }
@@ -2644,6 +2646,36 @@ sub Read_History_With_TmpUpdate {
                                if (! scalar %SectionsToLoad) { debug(" Stop reading history file. Got all we need."); last; }
                                next;
                        }
+                       # BEGIN_WORMS
+                       if ($field[0] eq 'BEGIN_WORMS')   {
+                               if ($Debug) { debug(" Begin of WORMS section"); }
+                               $field[0]='';
+                               my $count=0;my $countloaded=0;
+                               do {
+                                       if ($field[0]) {
+                                               $count++;
+                                               if ($SectionsToLoad{'worms'}) {
+                                                       $countloaded++;
+                                                       if ($field[1]) { $_worm_h{$field[0]}+=$field[1]; }
+                                                       $_worm_k{$field[0]}+=$field[2];
+                                                       if (! $_worm_l{$field[0]}) { $_worm_l{$field[0]}=int($field[3]); }
+                                               }
+                                       }
+                                       $_=<HISTORY>;
+                                       chomp $_; s/\r//;
+                                       @field=split(/\s+/,$_); $countlines++;
+                               }
+                               until ($field[0] eq 'END_WORMS' || ! $_);
+                               if ($field[0] ne 'END_WORMS') { error("History file \"$filetoread\" is corrupted (End of section WORMS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
+                               if ($Debug) { debug(" End of WORMS section ($count entries, $countloaded loaded)"); }
+                               delete $SectionsToLoad{'worms'};
+                               if ($SectionsToSave{'worms'}) {
+                                       Save_History('worms',$year,$month); delete $SectionsToSave{'worms'};
+                                       if ($withpurge) { %_worm_h=(); %_worm_k=(); %_worm_l=(); }
+                               }
+                               if (! scalar %SectionsToLoad) { debug(" Stop reading history file. Got all we need."); last; }
+                               next;
+                       }
                        # BEGIN_EMAILS
                        if ($field[0] eq 'BEGIN_EMAILSENDER')   {
                                if ($Debug) { debug(" Begin of EMAILSENDER section"); }
@@ -7005,9 +7037,9 @@ if (scalar keys %HTMLOutput) {
                                if ($ShowRobotsStats)            { print ($frame?"<tr><td class=\"awsm\">":""); print "<a href=\"$linkanchor#robots\"$targetpage>$Message[53]</a>"; print ($frame?"</td></tr>\n":" &nbsp; "); }
                                if ($ShowRobotsStats)            { print ($frame?"<tr><td class=\"awsm\"> &nbsp; <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> ":""); print "<a href=\"".($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks?XMLEncode("$AWScript?${NewLinkParams}output=allrobots"):"$PROG$StaticLinks.allrobots.$StaticExt")."\"$NewLinkTarget>$Message[80]</a>\n"; print ($frame?"</td></tr>\n":" &nbsp; "); }
                                if ($ShowRobotsStats =~ /L/i)   { print ($frame?"<tr><td class=\"awsm\"> &nbsp; <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> ":""); print "<a href=\"".($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks?XMLEncode("$AWScript?${NewLinkParams}output=lastrobots"):"$PROG$StaticLinks.lastrobots.$StaticExt")."\"$NewLinkTarget>$Message[9]</a>\n"; print ($frame?"</td></tr>\n":" &nbsp; "); }
-#                              if ($ShowWormsStats)             { print ($frame?"<tr><td class=\"awsm\">":""); print "<a href=\"$linkanchor#worms\"$targetpage>$Message[136]</a>"; print ($frame?"</td></tr>\n":" &nbsp; "); }
-#                              if ($ShowWormsStats)             { print ($frame?"<tr><td class=\"awsm\"> &nbsp; <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> ":""); print "<a href=\"".($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks?XMLEncode("$AWScript?${NewLinkParams}output=allworms"):"$PROG$StaticLinks.allworms.$StaticExt")."\"$NewLinkTarget>$Message[80]</a>\n"; print ($frame?"</td></tr>\n":" &nbsp; "); }
-#                              if ($ShowWormsStats =~ /L/i)    { print ($frame?"<tr><td class=\"awsm\"> &nbsp; <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> ":""); print "<a href=\"".($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks?XMLEncode("$AWScript?${NewLinkParams}output=lastworms"):"$PROG$StaticLinks.lastworms.$StaticExt")."\"$NewLinkTarget>$Message[9]</a>\n"; print ($frame?"</td></tr>\n":" &nbsp; "); }
+                               if ($ShowWormsStats)             { print ($frame?"<tr><td class=\"awsm\">":""); print "<a href=\"$linkanchor#worms\"$targetpage>$Message[136]</a>"; print ($frame?"</td></tr>\n":" &nbsp; "); }
+                               #if ($ShowWormsStats)            { print ($frame?"<tr><td class=\"awsm\"> &nbsp; <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> ":""); print "<a href=\"".($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks?XMLEncode("$AWScript?${NewLinkParams}output=allworms"):"$PROG$StaticLinks.allworms.$StaticExt")."\"$NewLinkTarget>$Message[80]</a>\n"; print ($frame?"</td></tr>\n":" &nbsp; "); }
+                               #if ($ShowWormsStats =~ /L/i)   { print ($frame?"<tr><td class=\"awsm\"> &nbsp; <img height=\"8\" width=\"9\" src=\"$DirIcons/other/page.png\" alt=\"...\" /> ":""); print "<a href=\"".($ENV{'GATEWAY_INTERFACE'} || !$StaticLinks?XMLEncode("$AWScript?${NewLinkParams}output=lastworms"):"$PROG$StaticLinks.lastworms.$StaticExt")."\"$NewLinkTarget>$Message[9]</a>\n"; print ($frame?"</td></tr>\n":" &nbsp; "); }
                                if ($linetitle) { print ($frame?"":"</td></tr>\n"); }
                                # Navigation
                                $linetitle=&AtLeastOneNotNull($ShowSessionsStats,$ShowPagesStats,$ShowFileTypesStats,$ShowFileSizesStats,$ShowOSStats,$ShowBrowsersStats,$ShowScreenSizeStats);
@@ -9082,6 +9114,48 @@ if (scalar keys %HTMLOutput) {
                        }
                        &tab_end("* $Message[156]".($TotalRRobots?" $Message[157]":""));
                }
+
+               # BY WORMS
+               #----------------------------
+               if ($ShowWormsStats) {
+                       if ($Debug) { debug("ShowWormsStats",2); }
+                       print "$Center<a name=\"worms\">&nbsp;</a><br />\n";
+                       &tab_head("$Message[163] ($Message[77] $MaxNbOf{'WormsShown'})",19,0,'worms');
+                       print "<tr bgcolor=\"#$color_TableBGRowTitle\"".($TOOLTIPON?" onmouseover=\"ShowTip(16);\" onmouseout=\"HideTip(16);\"":"")."><th>".(scalar keys %_worm_h)." $Message[164]*</th>";
+                       if ($ShowWormsStats =~ /H/i) { print "<th bgcolor=\"#$color_h\" width=\"80\">$Message[57]</th>"; }
+                       if ($ShowWormsStats =~ /B/i) { print "<th bgcolor=\"#$color_k\" width=\"80\">$Message[75]</th>"; }
+                       if ($ShowWormsStats =~ /L/i) { print "<th width=\"120\">$Message[9]</th>"; }
+                       print "</tr>\n";
+                       $total_p=$total_h=$total_k=0;
+                       my $count=0;
+                       &BuildKeyList($MaxNbOf{'WormsShown'},$MinHit{'Worm'},\%_worm_h,\%_worm_h);
+                       foreach my $key (@keylist) {
+                               print "<tr><td class=\"aws\">".($PageDir eq 'rtl'?"<span dir=\"ltr\">":"").($WormsHashLib{$key}?$WormsHashLib{$key}:$key).($PageDir eq 'rtl'?"</span>":"")."</td>";
+                               if ($ShowWormsStats =~ /H/i) { print "<td>".$_worm_h{$key}."</td>"; }
+                               if ($ShowWormsStats =~ /B/i) { print "<td>".Format_Bytes($_worm_k{$key})."</td>"; }
+                               if ($ShowWormsStats =~ /L/i) { print "<td>".($_worm_l{$key}?Format_Date($_worm_l{$key},1):'-')."</td>"; }
+                               print "</tr>\n";
+                               #$total_p += $_worm_p{$key};
+                               $total_h += $_worm_h{$key};
+                               $total_k += $_worm_k{$key}||0;
+                               $count++;
+                               }
+                       # For worms we need to count Totals
+                       my $TotalPagesWorms = 0; #foreach (values %_worm_p) { $TotalPagesWorms+=$_; }
+                       my $TotalHitsWorms = 0; foreach (values %_worm_h) { $TotalHitsWorms+=$_; }
+                       my $TotalBytesWorms = 0; foreach (values %_worm_k) { $TotalBytesWorms+=$_; }
+                       $rest_p=0;      #$rest_p=$TotalPagesRobots-$total_p;
+                       $rest_h=$TotalHitsWorms-$total_h;
+                       $rest_k=$TotalBytesWorms-$total_k;
+                       if ($rest_p > 0 || $rest_h > 0 || $rest_k > 0) {        # All other worms
+                               print "<tr><td class=\"aws\"><span style=\"color: #$color_other\">$Message[2]</span></td>";
+                               if ($ShowWormsStats =~ /H/i) { print "<td>".($rest_h)."</td>"; }
+                               if ($ShowWormsStats =~ /B/i) { print "<td>".(Format_Bytes($rest_k))."</td>"; }
+                               if ($ShowWormsStats =~ /L/i) { print "<td>&nbsp;</td>"; }
+                               print "</tr>\n";
+                       }
+                       &tab_end("* $Message[158]");
+               }
        
                print "\n<a name=\"HOW\">&nbsp;</a>\n\n";
        
index 53b63b3b936fa612beec270cc33a7147edc86595..cc87a937406d9beec0929f269b38331c0041d10b 100644 (file)
@@ -163,3 +163,5 @@ message159=Not viewed trafic is trafic generated by robots, worms or answers wit
 message160=Viewed traffic
 message161=Not viewed traffic
 message162=Monthly history
+message163=Worms
+message164=different worms
index c5103387d1b1ee0e2c5f53c29638112a53d369b7..970adfad773385890413e275e3916d5b56a161b0 100644 (file)
@@ -163,3 +163,5 @@ message159=Le trafic 'non vu' est le trafic g
 message160=Trafic 'vu'
 message161=Trafic 'non vu'
 message162=Historique mensuel
+message163=Worms
+message164=different worms
\ No newline at end of file