#! /usr/bin/perl -w
-# Copyright (c) 2003 Henk Penning, all rights reserved.
-# penning@cs.uu.nl, http://www.cs.uu.nl/staff/henkp.html
+# Copyright (c) 2003-2014 Henk Penning, all rights reserved.
+# penning@uu.nl, http://www.staff.science.uu.nl/~penni101/
# Version 1.1 was donated to the Apache Software Foundation 2003 Jan 28.
+#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
use strict ;
our $PRG = 'mirmon' ;
-our $VER = "2.3" ;
+our $VER = "2.10" ;
our $DEF_TIMEOUT = 300 ;
our $HIST = 14 ;
our $TIM_PAT = '^(\d+)([smhd])$' ;
-our %APA_TYPES = () ; for ( qw(backup ftp http) ) { $APA_TYPES { $_ } ++ ; }
-our %GET_OPTS = () ; for ( qw(all update) ) { $GET_OPTS { $_ } ++ ; }
+our %APA_TYPES = () ; $APA_TYPES { $_ } ++ for qw(backup ftp http rsync) ;
+our %GET_OPTS = () ; $GET_OPTS { $_ } ++ for qw(all update url) ;
our $HIST_DELTA = 24 * 60 * 60 ;
-our $APRX_DELTA = 60 ;
-our $HOME = 'http://www.cs.uu.nl/people/henkp/mirmon/' ;
+our $APRX_DELTA = 300 ;
+our $HOME = 'http://www.staff.science.uu.nl/~penni101/mirmon/' ;
package Base ; #####################################################
{ my $self = shift ;
my $arg = shift ;
my @LIST = $arg ? ( $arg ) : Mirmon -> config_list ;
- for my $conf ( @LIST ) { return $conf if -f $conf ; }
+ for my $conf ( @LIST ) { return $conf if -r $conf and ! -d $conf ; }
die sprintf "can't find a config file :\n %s\n" , join "\n ", @LIST ;
}
sub get_state
{ my $self = shift ;
my $conf = $self -> conf ;
+ my $name = $conf -> project_name ;
my $state = $conf -> state ;
my $res = {} ;
open STATE, $state or die "can't open $state ($!)" ;
my $mlist = $conf -> mirror_list ;
my $style = $conf -> list_style ;
my %in_list = () ;
+ my $changes = '' ;
open MLIST, $mlist or die "can't open $mlist ($!)" ;
for my $line ( <MLIST> )
{ chop $line ;
$in_list { $url } ++ ;
unless ( exists $res -> { $url } )
- { printf "*** added to list %s\n", $url unless Mirmon::quiet ;
+ { $changes .= sprintf "added %s\n", $url unless Mirmon::quiet ;
$res -> { $url } = Mirmon::Mirror -> init ( $self, $url ) ;
}
my $mirror = $res -> { $url } ;
for my $url ( sort keys %$res )
{ # printf "%s\n", $res -> { $url } -> state ;
unless ( exists $in_list { $url } )
- { printf "*** removed from list %s\n", $url unless Mirmon::quiet ;
+ { $changes .= sprintf "removed %s\n", $url unless Mirmon::quiet ;
delete $res -> { $url } ;
}
}
+ printf "changes in mirror-list for '%s':\n%s", $name, $changes
+ if $changes ;
$self -> state ( $res ) ;
}
{ chop ;
next if /^#/ ;
my ( $code, $dash, $reg ) = split ' ', $_, 3 ;
- $self -> { regions } { lc $code } = lc $reg ;
+ $self -> { regions } { lc $code } = $reg ;
}
close REGS ;
}
+sub _cmp_ccs
+ { my $ccs = shift ;
+ my $x = shift ;
+ my $y = shift ;
+ my $xx = $ccs -> { $x } ;
+ my $yy = $ccs -> { $y } ;
+ if ( ! defined $xx and ! defined $yy )
+ { $x cmp $y ; }
+ elsif ( ! defined $xx )
+ { -1 ; }
+ elsif ( ! defined $yy )
+ { +1 ; }
+ else
+ { $xx cmp $yy ; }
+ }
+
+sub _pr_round
+ { my $x = shift ;
+ my $i = int $x ;
+ my $f = $x - $i ;
+ $i + ( rand 1 < $f ? 1 : 0 ) ;
+ }
+
+sub _diag_qs
+ { my $qs = shift ;
+ join ', ', map { sprintf "%s %s" , $_, scalar @{ $qs -> { $_ } } ; }
+ sort keys %$qs ;
+ }
+
+sub _rpick
+ { my $row = shift ;
+ die "_rpick : row empty" unless @$row ;
+ my $idx = int rand @$row ;
+ my $res = $row -> [ $idx ] ;
+ $row -> [ $idx ] = $row -> [ $#{$row} ] ;
+ pop @$row ;
+ $res ;
+ }
+
+sub _buck_split
+ { my $que = shift ;
+ my $tmp = [] ;
+ for my $mirr ( @$que )
+ { my $lp = $mirr -> last_probe ;
+ my $hr = int ( ( $^T - $lp ) / 60 / 60 + 0.5 ) ;
+ push @{ $tmp -> [ $hr ] }, $mirr ;
+ }
+ [ grep defined $_, @$tmp ] ;
+ }
+
+sub _buck_join
+ { my $bucks = shift ;
+ my $res = [] ;
+ push @$res, @$_ for @$bucks ;
+ $res ;
+ }
+
+sub _buck_pick
+ { my $bucks = shift ;
+ die "buck_pick : bucks empty" unless @$bucks ;
+ my $buck = ( sort { @$b <=> @$a } @$bucks ) [ 0 ] ;
+ _rpick $buck ;
+ }
+
+sub _randomize
+ { my $ques = shift ;
+ my $poll = shift ;
+ my $hrs = int ( $poll / 60 / 60 + 0.5 ) ;
+
+ my $diag1 = _diag_qs $ques ;
+
+ my $todos = $ques -> { todo } ;
+ my $dones = $ques -> { done } ;
+ my $cnt = @$todos + @$dones ;
+ my $avg = $hrs ? $cnt / $hrs : 0 ;
+ my $iavg = _pr_round $avg ;
+ my $pick = 0 ;
+ my $bucks = _buck_split $dones ;
+
+ while ( @$todos < $iavg and $pick < @$dones )
+ { push @$todos, _buck_pick $bucks ;
+ $pick ++ ;
+ }
+
+ $ques -> { done } = _buck_join $bucks ;
+
+ sprintf ''
+ . " hrs %s, %s\n"
+ . " avg %.2f -> %d , picked %d ; queued %s\n"
+ . " hrs %s, %s\n"
+ , $hrs, $diag1
+ , $avg, $iavg, $pick, scalar @$todos
+ , $hrs, _diag_qs ( $ques )
+ ;
+ }
+
sub get_dates
{ my $self = shift ;
my $get = shift ;
+ my $URL = shift ;
my $state = $self -> state ;
- my $conf = $self -> conf ;
- my $CMD = $conf -> probe ;
- my $PAR = $conf -> max_probes ;
- my %m4h = () ;
- my @QUE = () ;
- my @NOQ = () ;
- my $GET = IO::Select -> new () ;
-
- my $cnt = 0 ;
- my $nok = 0 ;
-
- for my $url ( sort keys %$state )
- { my $mirror = $state -> { $url } ;
- $cnt ++ if $mirror -> last_status eq 'ok' ;
- if ( $get eq 'all' or $mirror -> last_probe eq 'undef' )
- { push @QUE, $mirror ; }
- elsif ( $get eq 'update' )
- { my $stat = $mirror -> last_status ;
+ my $conf = $self -> conf ;
+ my $CMD = $conf -> probe ;
+ my $PAR = $conf -> max_probes ;
+ my %m4h = () ;
+ my @QUE = () ;
+ my $GET = IO::Select -> new () ;
+ my $ques = {} ;
+ for my $col ( qw(new red grn xtr) )
+ { $ques -> { $col } { $_ } = [] for qw(done todo) ; }
+ my $max_poll = s4tim $conf -> max_poll ;
+ my $min_poll = s4tim $conf -> min_poll ;
+
+ if ( Mirmon::verbose ) { printf "mirrors %d\n", scalar keys %$state ; }
+
+ if ( $get eq 'all' )
+ { @QUE = sort { $a -> url cmp $b -> url } values %$state ; }
+ elsif ( $get eq 'url' )
+ { @QUE = ( $state -> { $URL } ) ; }
+ elsif ( $get eq 'update' )
+ { my $maxp = $^T - $max_poll ;
+ my $minp = $^T - $min_poll ;
+
+if ( Mirmon::verbose )
+ { printf "max_poll %s\n", scalar localtime $maxp ;
+ printf "min_poll %s\n", scalar localtime $minp ;
+ }
+ for my $url ( sort keys %$state )
+ { my $mirror = $state -> { $url } ;
+ my $stat = $mirror -> last_status ;
my $vrfy = $mirror -> last_ok_probe ;
my $lprb = $mirror -> last_probe ;
- if ( aprx_le $lprb, $^T - s4tim $conf -> min_poll )
- { if ( $stat ne 'ok' )
- { push @QUE, $mirror ; $nok ++ ; }
- elsif ( aprx_le $vrfy, $^T - s4tim $conf -> max_poll )
- { push @QUE, $mirror ; }
- else
- { push @NOQ, $mirror ; }
+ my $col ;
+ my $que ;
+ if ( $stat eq 'undef' ) # never probed ; new mirror ; todo
+ { $col = 'new' ; $que = 'todo' ; }
+ elsif ( $conf -> get_xtr ( $mirror -> region ) )
+ { $col = 'xtr' ; $que = 'todo' ; }
+ else
+ { my $poll = $stat eq 'ok' ? $maxp : $minp ;
+ $col = $stat eq 'ok' ? 'grn' : 'red' ;
+ $que = ( aprx_le $lprb, $poll ) ? 'todo' : 'done' ;
}
+ push @{ $ques -> { $col } { $que } }, $mirror ;
}
- else
- { die "unknown opt_get '$get'" ; }
- }
- if ( Mirmon::verbose )
- { my $que = scalar @QUE ; my $noq = scalar @NOQ ;
- printf "ok mirrors %d, queued %d, not queued %d, ok %d, nok %d\n"
- , $cnt, $que, $noq, $que - $nok, $nok
- }
-
- if ( $conf -> randomize )
- { my $hrs = int ( ( s4tim $conf -> max_poll ) / 60 / 60 + 0.5 ) ;
- my $avg = int ( $cnt / $hrs + 0.5 ) ;
- my $prc = ( scalar keys %$state ) / 50 ;
- my $flr = int $prc ;
- my $extras = $flr + ( rand 1 < ( $prc - $flr ) ) ;
- my $picked = 0 ;
-
- while ( @QUE < $avg + $nok and @NOQ and $picked < $extras )
- { my $idx = int rand @NOQ ;
- push @QUE, $NOQ [ $idx ] ;
- $NOQ [ $idx ] = $NOQ [ $#NOQ ] ;
- pop @NOQ ;
- $picked ++ ;
+ if ( $conf -> randomize )
+ { my $msg = "randomize green\n" ;
+ $msg .= _randomize $ques -> { grn }, $max_poll ;
+ $msg .= "randomize red\n" ;
+ $msg .= _randomize $ques -> { red }, $min_poll ;
+ print $msg if Mirmon::verbose ;
}
-
- printf "avg mirrors/hr %d, max extras %d, picked %d ; queued %s\n"
- , $avg, $extras, $picked, scalar @QUE if Mirmon::verbose ;
+ @QUE =
+ ( @{ $ques -> { new } { todo } }
+ , @{ $ques -> { red } { todo } }
+ , @{ $ques -> { grn } { todo } }
+ , @{ $ques -> { xtr } { todo } }
+ ) ;
}
+ else
+ { die "unknown opt_get '$get'" ; }
+
+ if ( Mirmon::verbose ) { printf "queued %d\n\n", scalar @QUE ; }
while ( @QUE )
{ my $started = 0 ;
{ $res .= sprintf "<BR>each %s unit represents %s mirror sites.\n"
, $units, sprintf ( "%.1f", $max / $H ) ;
}
- return H2 ( 'age histogram' ) . BQ $res ;
+ return H2 ( NAM 'age-histogram', 'age histogram' )
+ . BQ $res ;
}
sub gen_page
HEAD
for my $reg
- ( sort
- { ( $CCS -> { $a } || $a ) cmp ( $CCS -> { $b } || $b ) ; }
- keys %tab
- )
+ ( sort { _cmp_ccs $CCS, $a, $b } keys %tab )
+# { ( $CCS -> { $a } ? lc ( $CCS -> { $a } ) : $a )
+# cmp ( $CCS -> { $b } ? lc ( $CCS -> { $b } ) : $b )
+# } keys %tab
+# )
{ my $mirrors = $tab { $reg } ;
my $ccs = exists $CCS -> { $reg } ? $CCS -> { $reg } : $reg ;
for my $mirror ( sort { $a -> cmp ( $b ) } @$mirrors )
{ print "<TR>\n" ;
printf " <TD ALIGN=RIGHT>%s %s</TD>\n <TD>%s</TD>\n"
- , $mirror -> site_url
- , $mirror -> home_url
+ , $mirror -> url_site
+ , $mirror -> url_home
, $mirror -> type
;
, htm_top => ''
, htm_foot => ''
, htm_head => ''
+ , always_get => ''
) ;
our @REQ_KEYS =
eval Base -> mk_methods ( keys %CNF_KEYS, qw(root site_url) ) ;
+sub get_xtr
+ { my $self = shift ;
+ my $reg = shift ;
+ scalar grep { $_ eq $reg } split ' ', $self -> always_get ;
+ }
+
sub new
{ my $self = shift ;
my $FILE = shift ;
sub _parse
{ my $self = shift ;
my $url = $self -> url ;
- my ( $type, $site, $home ) ;
+ my ( $type, $site, $home, $path ) ;
if ( $url =~ m!^(ftp|https?|rsync)://([^/:]+)(:\d+)?/! )
- { $type = $1 ; $site = $2 ; $home = $& ; }
- return $type, $site, $home ;
+ { $type = $1 ; $site = $2 ; $home = $& ; $path = $' ; }
+ else
+ { warn "can't parse url ($url)" ; }
+ return $type, $site, $home, $path ;
}
sub type { my $self = shift ; ( $self -> _parse ) [ 0 ] ; }
sub site { my $self = shift ; ( $self -> _parse ) [ 1 ] ; }
sub home { my $self = shift ; ( $self -> _parse ) [ 2 ] ; }
+sub path { my $self = shift ; ( $self -> _parse ) [ 3 ] ; }
sub age_in_days
{ my $self = shift ;
if ( $res !~ /^\d+$/ )
{ $res =~ s/ /_/g ;
$res = Base::htmlquote $res ;
- $res = substr ( $time, 0, 15 ) . '..' if length $res > 15 ;
+ $res = substr ( $res, 0, 15 ) . '..' if length $res > 15 ;
$stat = "'$res'" ;
}
else
$hrf =~ /^rsync/ ? $txt : URL $hrf, $txt ;
}
-sub site_url { my $self = shift ; _url $self -> url , $self -> site ; }
-sub home_url { my $self = shift ; _url $self -> home, '@' ; }
+sub url_site
+ { my $self = shift ;
+ my $type = $self -> type ;
+ if ( $type eq 'rsync' )
+ { my $path = $self -> path ;
+ chop $path if $path =~ m!/$! ;
+ sprintf '%s::%s', $self -> site , $path ;
+ }
+ else
+ { URL $self -> url , $self -> site ; }
+ }
+
+sub url_home
+ { my $self = shift ;
+ my $type = $self -> type ;
+ if ( $type eq 'rsync' )
+ { '@' ; }
+ else
+ { URL $self -> home, '@' ; }
+ }
=pod
Returns the list of default locations for config files.
-=item B<get_dates ( $get )>
+=item B<get_dates ( $get [, $URL] )>
-Probes all mirrors if $get is C<all> ; or a subset if $get is C<update>.
+Probes all mirrors if $get is C<all> ; or a subset if $get is C<update> ;
+or only I<$URL> if $get is C<url>.
=back
=item B<age>
-The mirror's timestamp found by the last succesful probe,
+The mirror's timestamp found by the last successful probe,
or 'undef' if no probe was ever successful.
=item B<last_status>
=item B<last_ok_probe>
-The timestamp of the last succesful probe or 'undef'
+The timestamp of the last successful probe or 'undef'
if the mirror was never successfully probed.
=item B<probe_history>
=begin html
-<A HREF="mirmon.html">mirmon(1)</A>
+<p>
+<a href="mirmon.html">mirmon(1)</a>
+</p>
=end html
=begin html
- © 2003-2010
- <A HREF="http://people.cs.uu.nl/henkp/">Henk P. Penning</A>,
- <A HREF="http://www.cs.uu.nl/">Computer Science Department</A>,
- <A HREF="http://www.uu.nl/">Utrecht University</A>
- <BR>
- mirmon-2.3 - Wed Mar 17 09:29:11 2010 ; henkp
+ <p>
+ © 2003-2014
+ <a href="http://www.staff.science.uu.nl/~penni101/">Henk P. Penning</a>,
+ <a href="http://www.uu.nl/faculty/science/EN/">Faculty of Science</a>,
+ <a href="http://www.uu.nl/">Utrecht University</a>
+ <br />
+ mirmon-2.10 - Fri Aug 15 12:26:55 2014 ; henkp ;
+ <a href="http://validator.w3.org/check?uri=referer">verify html</a>
+ </p>
=end html
=begin man
- (c) 2003-2010 Henk P. Penning
- Computer Science Department, Utrecht University
- http://people.cs.uu.nl/henkp/ -- penning@cs.uu.nl
- mirmon-2.3 - Wed Mar 17 09:29:11 2010 ; henkp
+ (c) 2003-2014 Henk P. Penning
+ Faculty of Science, Utrecht University
+ http://www.staff.science.uu.nl/~penni101/ -- penning@uu.nl
+ mirmon-2.10 - Fri Aug 15 12:26:55 2014 ; henkp
=end man
=begin text
- (c) 2003-2010 Henk P. Penning
- Computer Science Department, Utrecht University
- http://people.cs.uu.nl/henkp/ -- penning@cs.uu.nl
- mirmon-2.3 - Wed Mar 17 09:29:11 2010 ; henkp
+ (c) 2003-2014 Henk P. Penning
+ Faculty of Science, Utrecht University
+ http://www.staff.science.uu.nl/~penni101/ -- penning@uu.nl
+ mirmon-2.10 - Fri Aug 15 12:26:55 2014 ; henkp
=end text
use IO::Select ;
use Net::hostent ;
-my $VERSION = Base::Version . ' - Wed Mar 17 09:29:11 2010 - henkp' ;
+my $VERSION = Base::Version . ' - Fri Aug 15 12:26:55 2014 - henkp' ;
my $DEF_CNF = join ', ', Mirmon -> config_list ;
my $TIMEOUT = Base::DEF_TIMEOUT ;
my $prog = substr $0, rindex ( $0, '/' ) + 1 ;
my $Usage = <<USAGE ;
-Usage: $prog [ -v ] [ -q ] [ -t timeout ] [ -get opt ] [ -c conf ]
+Usage: $prog [-v] [-q] [-t timeout] [-c conf] [-get all|update|url <url>]
option v : be verbose
option q : be quiet
option t : set timeout ; default $TIMEOUT
-option get : 'all' : probe all sites
- : 'update' : probe a selection of the sites (see doc)
+option get : get all : probe all sites
+ : get update : probe a selection of the sites (see doc)
+ : get url <url> : probe some <url> (in the mirror-list).
option c : configuration file ; default search :
( $DEF_CNF )
-------------------------------------------------------------------
Getopt::Long::config ( 'no_ignore_case' ) ;
my %opt = () ;
Usage '' unless GetOptions ( \%opt, qw(v q t=i get=s c=s version) ) ;
-Usage "Arg count\n" unless @ARGV == 0 ;
+Usage "Arg count\n" if @ARGV > 1 ;
+Usage "Arg count\n" if $opt{get} and $opt{get} eq 'url' and ! @ARGV ;
if ( $opt{version} ) { printf "%s\n", Base::version () ; exit ; }
$opt{v} ||= $opt{d} ;
+my $URL = shift ;
+
+my $M = Mirmon -> new ( $opt{c} ) ;
+$M -> conf -> timeout ( $opt{t} ) if $opt{t} ;
+
my $get = $opt{get} ;
-if ( $get and ! Base::is_get_opt ( $get ) )
- { Error "unknown 'get option' '$get'" ; }
+if ( $get )
+ { Error "url $URL not in list"
+ if $get eq 'url' and ! $M -> state -> { $URL } ;
+ Error "unknown 'get option' '$get'" unless Base::is_get_opt ( $get ) ;
+ }
Mirmon::verbose ( $opt{v} ) ;
Mirmon::debug ( $opt{d} ) ;
Mirmon::quiet ( $opt{q} ) ;
-my $M = Mirmon -> new ( $opt{c} ) ;
-$M -> conf -> timeout ( $opt{t} ) if $opt{t} ;
-if ( $get ) { $M -> get_dates ( $get ) ; $M -> put_state ; }
+if ( $get ) { $M -> get_dates ( $get, $URL ) ; $M -> put_state ; }
$M -> gen_page ( $get, $VERSION ) ;
__END__
=head1 SYNOPSIS
- mirmon [ -v ] [ -q ] [ -t timeout ] [ -get opt ] [ -c conf ]
+ mirmon [-v] [-q] [-t timeout] [-c conf] [-get all|update|url url]
=head1 OPTIONS
- option v : be verbose
- option q : be quiet
- option t : set timeout [ default 300 ] ;
- option get : 'all' : probe all sites
- : 'update' : probe a selection of the sites (see doc)
- option c : configuration file ; default list :
- ./mirmon.conf $HOME/.mirmon.conf /etc/mirmon.conf
- -------------------------------------------------------------------
- Mirmon normally only reports errors and changes in the mirror list.
- -------------------------------------------------------------------
+=over 4
+
+=item B<-v>
+
+Be verbose ; B<mirmon> normally only reports
+errors and changes in the mirror list.
+
+=item B<-q>
+
+Be quiet.
+
+=item B<-t> I<timeout>
+
+Set the timeout ; the default is I<300>.
+
+=item B<-get> all | update | url <url>
+
+With B<all>, probe all sites.
+With B<update>, probe a selection of the sites ; see option C<max_poll> below.
+With B<url>, probe only the given I<url>, which must appear in the mirror-list.
+
+=item B<-c> I<name>
+
+Use config file I<name>. The default list is
+
+ ./mirmon.conf $HOME/.mirmon.conf /etc/mirmon.conf
+
+=back
=head1 USAGE
|. part3
+--------------------------------------------------
-=head1 CONFIG FILE : required entries
+=head2 required entries
-=head2 project_name I<name>
+=over 4
+
+=item project_name I<name>
Specify a short plaintext name for the project.
project_name Apache
project_name CTAN
-=head2 project_url I<url>
+=item project_url I<url>
Specify an url pointing to the 'home' of the project.
project_url http://www.apache.org/
-=head2 mirror_list I<file-name>
+=item mirror_list I<file-name>
Specify the file containing the mirrors to probe.
Note that in style 'plain' the third item is reserved for an
optional email address : the site's contact address.
-Specify the required format with 'list_style' (see below).
+Specify the required format with option C<list_style> (see below).
The default style is 'plain'.
-=head2 web_page I<file-name>
+=item web_page I<file-name>
Specify where the html report page is written.
-=head2 icons I<directory-name>
+=item icons I<directory-name>
Specify the directory where the icons can be found,
relative to the I<web_page>, or relative to the
icons /icons/mirmon
-=head2 probe I<program + arguments>
+=item probe I<program + arguments>
Specify the program+args to probe the mirrors. Example:
- probe /usr/bin/wget -q -O - -T %TIMEOUT% -t 1 %URL%TIME
+ probe /usr/bin/wget -q -O - -T %TIMEOUT% -t 1 %URL%TIME.txt
Before the program is started, %TIMEOUT% and %URL% are
substituted with the proper timeout and url values.
Here it is assumed that each hour the root server writes
-a timestamp in /path/to/archive/TIME, for instance with
+a timestamp in /path/to/archive/TIME.txt, for instance with
a crontab entry like
- 42 * * * * perl -e 'printf "%s\n", time' > /path/to/archive/TIME
+ 42 * * * * perl -e 'print time, "\n"' > /path/to/archive/TIME.txt
Mirmon reads one line of output from the probe and interprets
the first word on that line as a timestamp ; for example :
Mirmon is distributed with a program C<probe> that handles
ftp, http and rsync urls.
-=head2 state I<file-name>
+=item state I<file-name>
Specify where the file containing the state is written.
The program reads this file on startup and writes the
file when mirrors are probed (-get is specified).
-=head2 countries I<file-name>
+=item countries I<file-name>
Specify the file containing the country codes;
The file should contain lines like
- us - united states
- nl - netherlands
+ us - United States
+ nl - Netherlands
The mirmon package contains a recent ISO list.
-=head1 CONFIG FILE : optional entries
+I<Fake> domains like I<Backup>, I<Master> are allowed,
+and are listed first in the report ; lowercase-first
+fake domains (like I<backup>) are listed last.
+
+=back
+
+=head2 optional entries
-=head2 max_probes I<number>
+=over 4
+
+=item max_probes I<number>
Optionally specify the number of parallel probes (default 25).
-=head2 timeout I<seconds>
+=item timeout I<seconds>
Optionally specify the timeout for the probes (default 300).
After the last probe is started, the program waits for
<timeout> + 10 seconds, cleans up and exits.
-=head2 project_logo I<logo>
+=item project_logo I<logo>
Optionally specify (the SRC of the IMG of) a logo to be placed
top right on the page.
project_logo /icons/apache.gif
project_logo http://www.apache.org/icons/...
-=head2 htm_head I<html>
+=item htm_head I<html>
Optionally specify some HTML to be placed before </HEAD>.
htm_head
<link REL=StyleSheet HREF="/style.css" TYPE="text/css">
-=head2 htm_top I<html>
+=item htm_top I<html>
Optionally specify some HTML to be placed near the top of the page.
htm_top testing 1, 2, 3
-=head2 htm_foot I<html>
+=item htm_foot I<html>
Optionally specify HTML to be placed near the bottom of the page.
<A HREF="..."><IMG SRC="..." BORDER=0></A>
<HR>
-=head2 put_histo top|bottom|nowhere
+=item put_histo top|bottom|nowhere
Optionally specify where the age histogram must be placed.
The default is 'top'.
-=head2 min_poll I<time-spec>
+=item min_poll I<time-spec>
For 'min_poll' see next item. A I<time-spec> is a number followed by
a unit 's' (seconds), or 'm' (minutes), or 'h' (hours), or 'd' (days).
For example '3d' (three days) or '36h' (36 hours).
-=head2 max_poll I<time-spec>
+=item max_poll I<time-spec>
Optionally specify the maximum probe interval. When the program is
called with option '-get update', all sites are probed which are :
The default 'min_poll' is '1h' (1 hour).
The default 'max_poll' is '4h' (4 hours).
-=head2 min_sync I<time-spec>
+=item min_sync I<time-spec>
Optionally specify how often the mirrors are required to make an update.
The default 'min_sync' is '1d' (1 day).
-=head2 max_sync I<time-spec>
+=item max_sync I<time-spec>
Optionally specify the maximum allowable sync interval.
Sites exceeding the limit will be considered 'old'.
The default 'max_sync' is '2d' (2 days).
-=head2 no_randomize
+=item always_get I<region ...>
-To balance the probe load over the hourly mirmon runs,
-mirmon may probe a few extra randomly choosen mirrors :
+Optionally specify a list of regions that must be probed always.
-=over 4
+ always_get Master Tier1
-=item * only if the the number of mirrors to probe is below average,
+This is intended for I<fake regions> like I<Master> etc.
-=item * at most 2% of the mirrors
+=item no_randomize
-=back
+Mirmon tries to balance the probe load over the hourly mirmon runs.
+If the current run has a below average number of mirrors to probe,
+mirmon probes a few extra, randomly chosen mirrors, picked from the
+runs that have the highest load.
If you don't want this behaviour, use B<no_randomize>.
-=head2 no_add_slash
+=item no_add_slash
If the url part of a line in the mirror_list doesn't end
in a slash ('/'), mirmon adds a slash and issues a warning
If you don't want this behaviour, use B<no_add_slash>.
-=head2 list_style plain|apache
+=item list_style plain|apache
Optionally specify the format ('plain' or 'apache') of the mirror-list.
See the description of 'mirror_list' above.
The default list_style is 'plain'.
-=head2 site_url I<site> I<url>
+=item site_url I<site> I<url>
Optionally specify a substitute url for a site.
another (sometimes secret) url can be used to probe the site.
The <site> of an url is the part between '://' and the first '/'.
-=head2 env I<key> I<value>
+=item env I<key> I<value>
Optionally specify an environment variable.
-=head2 include I<file-name>
+=item include I<file-name>
Optionally specify a file to include.
The include depth is unlimited. However, it is a fatal error to
include a file twice under the same name.
-=head2 show
+=item show
When the config processor encounters the 'show' command, it
dumps the content of the current config to standout, if option
C<-v> is specified. This is intented for debugging.
-=head2 exit
+=item exit
When the config processor encounters the 'exit' command, it
terminates the program. This is intented for debugging.
+=back
+
=head1 STATE FILE FORMAT
The state file consists of lines; one line per site.
=item * field 2 : age
-The mirror's timestamp found by the last succesful probe,
+The mirror's timestamp found by the last successful probe,
or 'undef' if no probe was ever successful.
=item * field 3 : status last probe
The status of the last probe, or 'undef' if the mirror was never probed.
-=item * field 4 : time last succesful probe
+=item * field 4 : time last successful probe
-The timestamp of the last succesful probe or 'undef'
+The timestamp of the last successful probe or 'undef'
if the mirror was never successfully probed.
=item * field 5 : probe history
=item * The mirmon repository is here :
- https://subversion.cs.uu.nl/repos/staff.henkp.mirmon/trunk/
+ https://svn.science.uu.nl/repos/project.mirmon/trunk/
=item * The mirmon tarball is here :
- http://people.cs.uu.nl/henkp/mirmon/mirmon.tar.gz
+ http://www.staff.science.uu.nl/~penni101/mirmon/mirmon.tar.gz
=back
where
- REPO = https://subversion.cs.uu.nl/repos/staff.henkp.mirmon/trunk/
+ REPO = https://svn.science.uu.nl/repos/project.mirmon/trunk/
or download the package and unpack it.
countries countries.list
web_page DOCUMENTROOT/mirmon/index.html
icons /mirmon/icons
- probe /usr/bin/wget -q -O - -T %TIMEOUT% -t 1 %URL%TIME
+ probe /usr/bin/wget -q -O - -T %TIMEOUT% -t 1 %URL%TIME.txt
-This assumes the project's timestamp is in file C<TIME>.
+This assumes the project's timestamp is in file C<TIME.txt>.
=item * If you have rsync urls, change the probe line to :
- probe perl /usr/local/src/mirmon/probe -t %TIMEOUT% %URL%TIME
+ probe perl /usr/local/src/mirmon/probe -t %TIMEOUT% %URL%TIME.txt
=item * Run mirmon :
=begin html
-<A HREF="mirmon.pm.html">mirmon.pm(3)</A>
+<p>
+<a href="mirmon.pm.html">mirmon.pm(3)</a>
+</p>
=end html
=begin html
- © 2003-2010
- <A HREF="http://people.cs.uu.nl/henkp/">Henk P. Penning</A>,
- <A HREF="http://www.cs.uu.nl/">Computer Science Department</A>,
- <A HREF="http://www.uu.nl/">Utrecht University</A>
- <BR>
- mirmon-2.3 - Wed Mar 17 09:29:11 2010 ; henkp
+ <p>
+ © 2003-2014
+ <a href="http://www.staff.science.uu.nl/~penni101/">Henk P. Penning</a>,
+ <a href="http://www.uu.nl/faculty/science/EN/">Faculty of Science</a>,
+ <a href="http://www.uu.nl/">Utrecht University</a>
+ <br />
+ mirmon-2.10 - Fri Aug 15 12:26:55 2014 ; henkp ;
+ <a href="http://validator.w3.org/check?uri=referer">verify html</a>
+ </p>
=end html
=begin man
- (c) 2003-2010 Henk P. Penning
- Computer Science Department, Utrecht University
- http://people.cs.uu.nl/henkp/ -- penning@cs.uu.nl
- mirmon-2.3 - Wed Mar 17 09:29:11 2010 ; henkp
+ (c) 2003-2014 Henk P. Penning
+ Faculty of Science, Utrecht University
+ http://www.staff.science.uu.nl/~penni101/ -- penning@uu.nl
+ mirmon-2.10 - Fri Aug 15 12:26:55 2014 ; henkp
=end man
=begin text
- (c) 2003-2010 Henk P. Penning
- Computer Science Department, Utrecht University
- http://people.cs.uu.nl/henkp/ -- penning@cs.uu.nl
- mirmon-2.3 - Wed Mar 17 09:29:11 2010 ; henkp
+ (c) 2003-2014 Henk P. Penning
+ Faculty of Science, Utrecht University
+ http://www.staff.science.uu.nl/~penni101/ -- penning@uu.nl
+ mirmon-2.10 - Fri Aug 15 12:26:55 2014 ; henkp
=end text