Zal hier even de bestandjes neergooien, want Perl heeft er geen zin in
eerst de striplog.pl die is alsvolgt:
#!/usr/bin/perl
#
# Dit script comprimeert pproxy log files tot 1 regel per ip-range per dag.
# Ondertussen doet het wat zoek- en vervang werk, waardoor hele ip-ranges onder een vaste
# naam in je ppstats terecht komen.
#
# 5 dingen die je in kan/moet stellen:
#
# 1:
# In de ppstats-rc5.ini:
# de regel: LogPre = "pinproxyrc5" # For rc5pkeyYYYYMMDD
# zetten (die staat er al, alleen ff pinproxy ipv pproxy).
# Zorg ervoor dat hieronder de paden bij de regels $biglog en $smallog kloppen!
#
# 2:
# In je ppstats-rc5.ini:
# CacheDays = 500 # Days to store cache before refreshing.
# Dan probeert ie niet steeds 10.1.x.x op te zoeken
#
# 3: In de ppstats-rc5.ini het consolidate UIT zetten
# ConsHosts = 0 # Do not consolidate hosts.
# #ConsHosts = 1 # Consolidate hosts.
#
# 4:
# Zie hieronder, bij: "Vul hieronder zelf de ip-ranges aan."
#
# 5:
# Zie hieronder bij: "Wil je oude logs doen?"
#
# Tip: maak een kopie van je ingevulde dns-cache file,
# voor als ppstats em per ongeluk overschrijft.
# succes!
sub nice_time
{
my @gmt = gmtime(shift @_);
my $i;
$gmt[4]++;
$gmt[5] += 1900;
for ($i = 0; $i < 5; $i++) {
while (length($gmt[$i]) < 2) {
$gmt[$i] = "0" . $gmt[$i];
}
}
return ($gmt[0], $gmt[1], $gmt[2], $gmt[3], $gmt[4], $gmt[5], $gmt[6]);
}
( $sec, $min, $hour, $mday, $month, $year, $wday) = nice_time(time);
# **************************************************************
# Wil je oude logs doen? zet een hekje voor de bovenste $logdate
# en haal het bij de onderste weg, en vul de juiste datum in.
# Bij "normale" werking moet het staan zoals nu.
# draai het script vervolgens zelf voor elke logfile die je wil doen
# (wel steeds datum aanpassen ofcourse)
$logdate = "$year$month$mday";
# $logdate = 20010114;
undef %full;
undef %final;
$biglog = "c:/koe/pproxyrc5" . $logdate . ".log";
$smallog = "c:/koe/logs/pinproxyrc5" . $logdate . ".log";
open (LEES, '<'."$biglog");
while (defined($entry = <LEES>)) {
chomp($entry);
$entry =~ tr/A-Z/a-z/;
($datetime, $ipaddr, $email, $block, $nkeys, $os, $cpu, $ver, $space) = split(/,/, $entry);
# *****************************************************************
# Vul hieronder zelf de ip-ranges aan.
# bijv: 195.121.x.x (WXS) wordt vervangen door 10.1.1.3
# in de rc5-dns.cache vul ik in:
# 10.1.1.3,NAAM_VAN_DE_GOZERT_DIE_WXS_GERUIKT,2000/09/14
# 10.1.1.4,NAAM_VAN_DE_GOZERT_DIE_WANNADOO_GERUIKT,2000/09/14
# hele adressen mogen ook, als je maar een \ voor de punt zet. (bv 212\.195\.23\.128)
$ipaddr =~ s/^194\.235\..+/10.1.1.3/; #Rendekooi
$ipaddr =~ s/^195\.61\..+/10.1.1.3/; #Rendekooi
$ipaddr =~ s/^62\.229\..+/10.1.1.3/; #rendokooi
$ipaddr =~ s/^195\.7\..+/10.1.1.3/; #rendokooi
$ipaddr =~ s/^193\.172\..+/10.1.1.2/; #Daxis
$ipaddr =~ s/^195\.241\..+/10.1.1.1/; #Worldonline
$ipaddr =~ s/^213\.75\..+/10.1.1.5/; #WXS
$ipaddr =~ s/^195\.85\..+/10.1.1.4/; #Freeacces
$ipaddr =~ s/^62\.59\..+/10.1.1.6/; #zonnet
$ipaddr =~ s/^193\.173\.177\.+/10.1.1.7/; #Nok nok
$ipaddr =~ s/^62\.58\..+/10.1.1.8/; #Freeacces
$ipaddr =~ s/^193\.173\.132\.+/10.1.1.9/; #Hccnet
$ipaddr =~ s/^62\.100\..+/10.1.1.10/; #freesurf
$ipaddr =~ s/^212\.123\..+/10.1.1.11/; #wish.net
$main="$email,$ipaddr,$os,$cpu,$ver";
if (defined($full{$main})) {
$full{$main} += "$nkeys";
$full{$main}{$main} = "$datetime,$block"; }
else {
$full{$main} = "$nkeys";
$full{$main}{$main} = "$datetime,$block"; }
}
close LEES;
if (defined(%full)) {
foreach $main (keys %full) {
($email, $ipaddr, $os, $cpu, $ver, $space) = split(/,/, $main);
($datetime, $block) = split(/,/, $full{$main}{$main});
$final{"$datetime,$ipaddr,$email,$block,$full{$main},$os,$cpu,$ver"} = 0;
}
open (SCHR, '>'."$smallog");
foreach $main (sort (keys %final)) { print SCHR "$main\n"; }
close SCHR; }
En zo heb ik mijn ppstats-rc5-7.1.pl:
#--- Input Options -----------------------------------------------------------
# Logfile name format information. This script does not correctly support
# formats other than YYYYMMDD. The logs in this example are kept in a
# subdirector called "logrc5", which can be configured in the proxy's ini.
# This script does require that daily logfile rotation is enabled. Other
# rotation time periods are not yet supported. LogDir should end in a "/".
LogDir = "c:/koe/logs/"
LogPre = "pinproxyrc5" # For pproxyrc5YYYYMMDD
LogSuf = "log" # For pproxyrc5YYYYMMDD.log
# The personal proxy can read compressed log files after they have been
# rotated. If you have this proxy option enabled and want to use ppstats,
# configure the following settings. The defaults are for UNIX gzip. Command
# that unzips the logfile to stdout without deleting the file is required.
#ProcessZipLogs = 0 # Ignore zipped log files.
ProcessZipLogs = 1 # Unzip and process all log files.
LogZipSuf = "log.gz" # For rc5pkeyYYYYMMDD.log.gz
LogTmpSuf = "log.tmp" # For rc5pkeyYYYYMMDD.log.tmp
LogDecompressor = "gzip -d -c" # Command line zip decompressor.
# Maximum number of days to read log files. A value of zero means
# read all available log files without limit. A value of 365 would mean
# only read back blocks done in the last year and ignore anything older.
MaxDays = 365
#--- Output Options ----------------------------------------------------------
# Full path to output file location. This should end in a "/".
HtmlDir = "c:/dpc/"
# Full URL of output web file location. This should end in a "/".
HtmlRoot = "http://www.asaputilities.com/dpc/"
# Realitive path to icon folder from htmldir and htmlroot. Default should work
# fine for most cases. This should end in a "/". If you haven't copied
# this folder from the zip distribution to your htmldir now is a good time.
IconDir = "icons/"
# HTML output filenames. You should configure IIS to use index.html as a
# default document, or rename the index.html's to default.htm
htmlteam = "index.html"
htmlexec = "exec.html"
htmlmail = "byemail.html"
htmlhost = "byhost.html"
htmlos = "byos.html"
htmlcpu = "bycpu.html"
htmlver = "byver.html"
htmlfull = "byfull.html"
htmldomain = "bydomain.html"
htmlhour = "byhour.html"
htmldate = "bydate.html"
htmlweek = "byweek.html"
htmlmonth = "bymonth.html"
htmlyear = "byyear.html"
htmldayofweek = "bydaywk.html"
htmlindvemail = "index.html"
htmlemailhist = "emailhist.html"
htmlhostsbyemail = "emailhosts.html"
htmlindvhost = "index.html"
htmlhosthist = "hosthist.html"
htmlemailsbyhost = "hostemails.html"
# Cascading style sheet filename. Will be created by ppstats for you.
css = "ppstats.css"
# All ip addresses from the proxy log files are converted to DNS names and
# then cached for a user defined amount of time. A value of zero means refresh
# on every run. This cache file is saved in your workingdir. If you run
# ppstats on a server with a slow internet connection, use a large cachedays.
CacheFile = "rc5-dns.cache" # DNS cache filename to be created.
CacheDays = 50 # Days to store cache before refreshing.
# GIF based chart options. Be sure to specify the full or relative path to the
# specially compiled GNUplot program with GIF support. Config and data files
# are create by ppstats for you.
GNUPlot = "C:\koe\gnuplot\pgnuplot.exe" # Path to GNUplot executable.
GNUPlotconfig = "gnuplot.ini" # GNUplot config file.
GNUPlotdata = "plot.data" # GNUplot data file.
GNUPlotoutput = "plot.gif" # Output GIF filename.
# The page counter component. See the documentation section above for details
# on how to obtain and use the Count.cgi program. To change the color of the
# displayed count number, change the prgb parameter. Note that you may have to
# do a 'echo "1" > rc5.dat' in your Counter/data folder for this to work. You
# can specify a different hit counter program by changing the counter variable.
UseCounter = 0 # Do not use the hit counter.
# UseCounter = 1 # Use the hit counter.
Counter = "/cgi-bin/Count.cgi?ft=0|tr=1|trgb=000000|srgb=00FF00|prgb=993333|md=8|dd=D|comma=T|df=rc5.dat"
# The By Host information page is sometimes not particularly practical for
# very large teams. You can display this section and ppstats will not record
# blocks submitted by host in any manner. The combined output file size and
# execution time will decrease substantially.
# ShowByHost = 0 # Do not show the By Host section.
ShowByHost = 1 # Show the By Host section.
#--- Format Options ----------------------------------------------------------
# GIF based chart line style option. The default width is 520 and the
# default height is 400. 800 by 600 is nice for people with large monitors.
# Any value of 1 or less will disable the nth-day average feature.
#ChartLineStyle = 1 # Impulses style. Not useful with nth day average.
ChartLineStyle = 2 # Lines style.
#ChartLineStyle = 3 # Linespoints style.
ChartWidth = 520 # GIF image width.
ChartHeight = 400 # GIF image height.
DayAverage = 21 # Days of nth-day average.
# Days to track up/down movement.
MovementDays = 1
# Maximum number of rows to show per category page.
MaxRows = 100
# Number of days to display on the history pages.
DaysHist = 7
# Number of days to display for individual block history.
BlockHistory = 31
# Use header and/or footer banners?
UseHeaderBanner = 0 # Do not use header banner.
#UseHeaderBanner = 1 # Use header banner.
#UseFooterBanner = 0 # Do not use footer banner.
UseFooterBanner = 1 # Use footer banner.
# Consolidate numbers in hosts? ie, host12.myisp.com -> host?.isp.com
# See rc5-domain.cons for a list of domains you wish to manual consolidate.
# See rc5-ip.cons for a list of ip addresses you wish to manual consolidate.
# For instance, an entry in rc5-domain.cons like slashdot.org will consolidate
# the hosts [url="http://www.slashdot.org,"]www.slashdot.org,[/url]
ftp.slashdot.org, and slashdot.org into
# ?.slashdot.org Some more examples are provided. Entries in rc5-domain.cons
# and rc5-ip.cons are processed regardless whether or not ConsHosts is
# enabled. Note that rc5-domain.cons works from the right, rc5-ip.cons the
# left. Note that the last entry in each array does not have a comma after it.
ConsHosts = 0 # Do not consolidate hosts.
# ConsHosts = 1 # Consolidate hosts.
Ik hoop dat jullie nu kunnen helpen.
Want op die Amd 233 duren de logs inderdaad behoorlijk tijdje nu
Thanks,
Tha dude
We're machines just like everything else in nature. (gasloos sinds 01-10-2020, WP: SW75YAA/ERSD-VM2D, DJG WPS 300, 18 hp CPC, 11,1 kWp