From: eldy <>
Date: Wed, 26 Nov 2003 18:01:53 +0000 (+0000)
Subject: Added a Worms report.
X-Git-Tag: AWSTATS_6_0_BETA~64
X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a60760e21fd33046492cc3cefbaba2522783b01;p=thirdparty%2FAWStats.git
Added a Worms report.
---
diff --git a/docs/awstats_changelog.txt b/docs/awstats_changelog.txt
index 40e67c44..81e86f95 100644
--- a/docs/awstats_changelog.txt
+++ b/docs/awstats_changelog.txt
@@ -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.
diff --git a/docs/awstats_config.html b/docs/awstats_config.html
index dfdc01db..68c0fbbc 100644
--- a/docs/awstats_config.html
+++ b/docs/awstats_config.html
@@ -134,6 +134,7 @@ when reading it), follow the example:
ShowHostsStats
ShowAuthenticatedUsers
ShowRobotsStats
+ShowWormsStats
ShowSessionsStats
ShowPagesStats
ShowCompressionStats
@@ -1281,6 +1282,7 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors
5.5+ for ShowDaysOfMonthStats
5.6+ for ShowMiscStats,ShowSTMPErrorsStats
5.8+ for ShowClusterStats
+6.0+ for ShowWormsStats
# You choose here which reports you want to see in the main page and what you
# want to see in those reports.
# Possible values:
@@ -1326,6 +1328,9 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors
# Show robots chart
# Default: HBL, Possible codes: HBL
ShowRobotsStats=HBL
+
# Show worms chart
+
# Default: HBL, Possible codes: HBL
+
ShowWormsStats=HBL
# Show email senders chart (For use when analyzing mail log files)
# Default: 0, Possible codes: HBML
ShowEMailSenders=0
@@ -1456,7 +1461,7 @@ ShowOSStats,ShowOriginStats,ShowKeyphrasesStats,ShowKeywordsStats,ShowHTTPErrors
# List of visible flags with link 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"
# Default: "en es fr it nl es"
#
diff --git a/docs/awstats_setup.html b/docs/awstats_setup.html
index 7911b252..6d99d02c 100644
--- a/docs/awstats_setup.html
+++ b/docs/awstats_setup.html
@@ -41,7 +41,7 @@ AWStats common use is made in 3 steps:
-
Step 1 : Install and Setup
+
Step 1 : Install and Setup with configure.pl
A) With Apache or compatible server (on Unix/Linux, Windows, MacOS...)
diff --git a/wwwroot/cgi-bin/awstats.model.conf b/wwwroot/cgi-bin/awstats.model.conf
index 9545872d..0d328b64 100644
--- a/wwwroot/cgi-bin/awstats.model.conf
+++ b/wwwroot/cgi-bin/awstats.model.conf
@@ -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
+# Default: HBL, Possible codes: HBL
+ShowWormsStats=HBL
# 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: ""
diff --git a/wwwroot/cgi-bin/awstats.pl b/wwwroot/cgi-bin/awstats.pl
index c089b4d0..d60f9f0a 100644
--- a/wwwroot/cgi-bin/awstats.pl
+++ b/wwwroot/cgi-bin/awstats.pl
@@ -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]); }
+ }
+ }
+ $_=;
+ 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?"| ":""); print "$Message[53]"; print ($frame?" |
\n":" "); }
if ($ShowRobotsStats) { print ($frame?" ":""); print "$Message[80]\n"; print ($frame?" |
\n":" "); }
if ($ShowRobotsStats =~ /L/i) { print ($frame?" ":""); print "$Message[9]\n"; print ($frame?" |
\n":" "); }
-# if ($ShowWormsStats) { print ($frame?"| ":""); print "$Message[136]"; print ($frame?" |
\n":" "); }
-# if ($ShowWormsStats) { print ($frame?" ":""); print "$Message[80]\n"; print ($frame?" |
\n":" "); }
-# if ($ShowWormsStats =~ /L/i) { print ($frame?" ":""); print "$Message[9]\n"; print ($frame?" |
\n":" "); }
+ if ($ShowWormsStats) { print ($frame?"| ":""); print "$Message[136]"; print ($frame?" |
\n":" "); }
+ #if ($ShowWormsStats) { print ($frame?" ":""); print "$Message[80]\n"; print ($frame?" |
\n":" "); }
+ #if ($ShowWormsStats =~ /L/i) { print ($frame?" ":""); print "$Message[9]\n"; print ($frame?" |
\n":" "); }
if ($linetitle) { print ($frame?"":"\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
\n";
+ &tab_head("$Message[163] ($Message[77] $MaxNbOf{'WormsShown'})",19,0,'worms');
+ print "| ".(scalar keys %_worm_h)." $Message[164]* | ";
+ if ($ShowWormsStats =~ /H/i) { print "$Message[57] | "; }
+ if ($ShowWormsStats =~ /B/i) { print "$Message[75] | "; }
+ if ($ShowWormsStats =~ /L/i) { print "$Message[9] | "; }
+ print "
\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 "| ".($PageDir eq 'rtl'?"":"").($WormsHashLib{$key}?$WormsHashLib{$key}:$key).($PageDir eq 'rtl'?"":"")." | ";
+ if ($ShowWormsStats =~ /H/i) { print "".$_worm_h{$key}." | "; }
+ if ($ShowWormsStats =~ /B/i) { print "".Format_Bytes($_worm_k{$key})." | "; }
+ if ($ShowWormsStats =~ /L/i) { print "".($_worm_l{$key}?Format_Date($_worm_l{$key},1):'-')." | "; }
+ print "
\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 "| $Message[2] | ";
+ if ($ShowWormsStats =~ /H/i) { print "".($rest_h)." | "; }
+ if ($ShowWormsStats =~ /B/i) { print "".(Format_Bytes($rest_k))." | "; }
+ if ($ShowWormsStats =~ /L/i) { print " | "; }
+ print "
\n";
+ }
+ &tab_end("* $Message[158]");
+ }
print "\n \n\n";
diff --git a/wwwroot/cgi-bin/lang/awstats-en.txt b/wwwroot/cgi-bin/lang/awstats-en.txt
index 53b63b3b..cc87a937 100644
--- a/wwwroot/cgi-bin/lang/awstats-en.txt
+++ b/wwwroot/cgi-bin/lang/awstats-en.txt
@@ -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
diff --git a/wwwroot/cgi-bin/lang/awstats-fr.txt b/wwwroot/cgi-bin/lang/awstats-fr.txt
index c5103387..970adfad 100644
--- a/wwwroot/cgi-bin/lang/awstats-fr.txt
+++ b/wwwroot/cgi-bin/lang/awstats-fr.txt
@@ -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