1
.\" Automatically generated by Pod::Man v1.37, Pod::Parser v1.14
4
.\" ========================================================================
5
.de Sh \" Subsection heading
13
.de Sp \" Vertical space (when we can't use .PP)
17
.de Vb \" Begin verbatim text
22
.de Ve \" End verbatim text
26
.\" Set up some character translations and predefined strings. \*(-- will
27
.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28
.\" double quote, and \*(R" will give a right double quote. | will give a
29
.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30
.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31
.\" expand to `' in nroff, nothing in troff, for use with C<>.
33
.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
37
. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
51
.\" If the F register is turned on, we'll generate index entries on stderr for
52
.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53
.\" entries marked with X<> in POD. Of course, you'll have to process the
54
.\" output yourself in some meaningful fashion.
57
. tm Index:\\$1\t\\n%\t"\\$2"
63
.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64
.\" way too many mistakes in technical documents.
68
.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69
.\" Fear. Run. Save yourself. No user-serviceable parts.
70
. \" fudge factors for nroff and troff
79
. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
85
. \" simple accents for nroff and troff
95
. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96
. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97
. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98
. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99
. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100
. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
102
. \" troff and (daisy-wheel) nroff accents
103
.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104
.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105
.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106
.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107
.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108
.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109
.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110
.ds ae a\h'-(\w'a'u*4/10)'e
111
.ds Ae A\h'-(\w'A'u*4/10)'E
112
. \" corrections for vroff
113
.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114
.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115
. \" for low resolution devices (crt and lpr)
116
.if \n(.H>23 .if \n(.V>19 \
129
.\" ========================================================================
132
.TH MIRMON 1 "2011-01-17" "perl v5.8.5" "User Contributed Perl Documentation"
134
mirmon \- monitor the state of mirrors
136
.IX Header "SYNOPSIS"
138
\& mirmon [ -v ] [ -q ] [ -t timeout ] [ -get opt ] [ -c conf ]
143
\& option v : be verbose
144
\& option q : be quiet
145
\& option t : set timeout [ default 300 ] ;
146
\& option get : 'all' : probe all sites
147
\& : 'update' : probe a selection of the sites (see doc)
148
\& option c : configuration file ; default list :
149
\& ./mirmon.conf $HOME/.mirmon.conf /etc/mirmon.conf
150
\& -------------------------------------------------------------------
151
\& Mirmon normally only reports errors and changes in the mirror list.
152
\& -------------------------------------------------------------------
156
The program is intended to be run by cron every hour.
159
\& 42 * * * * perl /path/to/mirmon -get update
162
It quietly probes a subset of the sites in a given list,
163
writes the results in the 'state' file and generates a web page
164
with the results. The subset contains the sites that are new, bad
165
and/or not probed for a specified time.
167
When no 'get' option is specified, the program just generates a
168
new web page from the last known state.
170
The program checks the mirrors by running a (user specified)
171
program on a pipe. A (user specified) number of probes is
172
run in parallel using nonblocking \s-1IO\s0. When something can be
173
read from the pipe, it switches the pipe to blocking \s-1IO\s0 and
174
reads one line from the pipe. Then it flushes and closes the
175
pipe. No attempt is made to kill the probe.
177
The probe should return something that looks like
183
that is, a line of text starting with a timestamp. The exit status
184
of the probe is ignored.
186
.IX Header "CONFIG FILE"
188
.IX Subsection "location"
189
A config file can be specified with the \-c option.
190
If \-c is not used, the program looks for a config file in
191
.IP "* \fB./mirmon.conf\fR" 4
192
.IX Item "./mirmon.conf"
194
.IP "* \fB$HOME/.mirmon.conf\fR" 4
195
.IX Item "$HOME/.mirmon.conf"
196
.IP "* \fB/etc/mirmon.conf\fR" 4
197
.IX Item "/etc/mirmon.conf"
200
.IX Subsection "syntax"
201
A config file looks like this :
204
\& +--------------------------------------------------
205
\& |# lines that start with '#' are comment
206
\& |# blank lines are ignored too
207
\& |# tabs are replaced by a space
209
\& |# the config entries are 'key' and 'value' pairs
210
\& |# a 'key' begins in column 1
211
\& |# the 'value' is the rest of the line
212
\& |somekey A_val B_val ...
213
\& |otherkey X_val Y_val ...
215
\& |# indented lines are glued
216
\& |# the next three lines mean 'somekey part1 part2 part3'
221
\& |# lines starting with a '+' are concatenated
222
\& |# the next three lines mean 'somekey part1part2part3'
227
\& |# lines starting with a '.' are glued too
228
\& |# don't use a '.' on a line by itself
229
\& |# 'somekey' gets the value "part1\en part2\en part3"
233
\& +--------------------------------------------------
235
.SH "CONFIG FILE : required entries"
236
.IX Header "CONFIG FILE : required entries"
237
.Sh "project_name \fIname\fP"
238
.IX Subsection "project_name name"
239
Specify a short plaintext name for the project.
242
\& project_name Apache
245
.Sh "project_url \fIurl\fP"
246
.IX Subsection "project_url url"
247
Specify an url pointing to the 'home' of the project.
250
\& project_url http://www.apache.org/
252
.Sh "mirror_list \fIfile-name\fP"
253
.IX Subsection "mirror_list file-name"
254
Specify the file containing the mirrors to probe.
257
\& mirror_list /path/to/mirror-list
260
If your mirror list is generated by a program, use
263
\& mirror_list /path/to/program arg1 ... |
266
Two formats are supported :
267
.IP "* plain : lines like" 4
268
.IX Item "plain : lines like"
270
\& us http://www.tux.org/ [email] ...
271
\& nl http://apache.cs.uu.nl/dist/ [email] ...
272
\& nl rsync://archive.cs.uu.nl/apache-dist/ [email] ...
274
.IP "* apache : lines like those in the apache mirrors.list" 4
275
.IX Item "apache : lines like those in the apache mirrors.list"
277
\& ftp us ftp://ftp.tux.org/pub/net/apache/dist/ user@tux.org ...
278
\& http nl http://apache.cs.uu.nl/dist/ user@cs.uu.nl ...
281
Note that in style 'plain' the third item is reserved for an
282
optional email address : the site's contact address.
284
Specify the required format with 'list_style' (see below).
285
The default style is 'plain'.
286
.Sh "web_page \fIfile-name\fP"
287
.IX Subsection "web_page file-name"
288
Specify where the html report page is written.
289
.Sh "icons \fIdirectory-name\fP"
290
.IX Subsection "icons directory-name"
291
Specify the directory where the icons can be found,
292
relative to the \fIweb_page\fR, or relative to the
293
\&\s-1DOCUMENTROOT\s0 of the web server.
295
If/when the \fIweb_page\fR lives in directory \f(CW\*(C`.../mirmon/\*(C'\fR and
296
the icons live in directory \f(CW\*(C`.../mirmon/icons/\*(C'\fR,
303
If/when the icons live in \f(CW\*(C`/path/to/DOCUMENTROOT/icons/mirmon/\*(C'\fR, specify
306
\& icons /icons/mirmon
308
.Sh "probe \fIprogram + arguments\fP"
309
.IX Subsection "probe program + arguments"
310
Specify the program+args to probe the mirrors. Example:
313
\& probe /usr/bin/wget -q -O - -T %TIMEOUT% -t 1 %URL%TIME
316
Before the program is started, \f(CW%TIMEOUT\fR% and \f(CW%URL\fR% are
317
substituted with the proper timeout and url values.
319
Here it is assumed that each hour the root server writes
320
a timestamp in /path/to/archive/TIME, for instance with
324
\& 42 * * * * perl -e 'printf "%s\en", time' > /path/to/archive/TIME
327
Mirmon reads one line of output from the probe and interprets
328
the first word on that line as a timestamp ; for example :
332
\& 1043625600 Mon Jan 27 00:00:00 2003
333
\& 1043625600 www.apache.org Mon Jan 27 00:00:00 2003
336
Mirmon is distributed with a program \f(CW\*(C`probe\*(C'\fR that handles
337
ftp, http and rsync urls.
338
.Sh "state \fIfile-name\fP"
339
.IX Subsection "state file-name"
340
Specify where the file containing the state is written.
342
The program reads this file on startup and writes the
343
file when mirrors are probed (\-get is specified).
344
.Sh "countries \fIfile-name\fP"
345
.IX Subsection "countries file-name"
346
Specify the file containing the country codes;
347
The file should contain lines like
350
\& us - united states
354
The mirmon package contains a recent \s-1ISO\s0 list.
355
.SH "CONFIG FILE : optional entries"
356
.IX Header "CONFIG FILE : optional entries"
357
.Sh "max_probes \fInumber\fP"
358
.IX Subsection "max_probes number"
359
Optionally specify the number of parallel probes (default 25).
360
.Sh "timeout \fIseconds\fP"
361
.IX Subsection "timeout seconds"
362
Optionally specify the timeout for the probes (default 300).
364
After the last probe is started, the program waits for
365
<timeout> + 10 seconds, cleans up and exits.
366
.Sh "project_logo \fIlogo\fP"
367
.IX Subsection "project_logo logo"
368
Optionally specify (the \s-1SRC\s0 of the \s-1IMG\s0 of) a logo to be placed
369
top right on the page.
372
\& project_logo /icons/apache.gif
373
\& project_logo http://www.apache.org/icons/...
375
.Sh "htm_head \fIhtml\fP"
376
.IX Subsection "htm_head html"
377
Optionally specify some \s-1HTML\s0 to be placed before </HEAD>.
381
\& <link REL=StyleSheet HREF="/style.css" TYPE="text/css">
383
.Sh "htm_top \fIhtml\fP"
384
.IX Subsection "htm_top html"
385
Optionally specify some \s-1HTML\s0 to be placed near the top of the page.
388
\& htm_top testing 1, 2, 3
390
.Sh "htm_foot \fIhtml\fP"
391
.IX Subsection "htm_foot html"
392
Optionally specify \s-1HTML\s0 to be placed near the bottom of the page.
397
\& <A HREF="..."><IMG SRC="..." BORDER=0></A>
400
.Sh "put_histo top|bottom|nowhere"
401
.IX Subsection "put_histo top|bottom|nowhere"
402
Optionally specify where the age histogram must be placed.
403
The default is 'top'.
404
.Sh "min_poll \fItime-spec\fP"
405
.IX Subsection "min_poll time-spec"
406
For 'min_poll' see next item. A \fItime-spec\fR is a number followed by
407
a unit 's' (seconds), or 'm' (minutes), or 'h' (hours), or 'd' (days).
408
For example '3d' (three days) or '36h' (36 hours).
409
.Sh "max_poll \fItime-spec\fP"
410
.IX Subsection "max_poll time-spec"
411
Optionally specify the maximum probe interval. When the program is
412
called with option '\-get update', all sites are probed which are :
415
the site appears in the list, but there is no known state
418
the last probe of the site was unsuccessful
421
the last probe was more than 'max_poll' ago.
423
Sites are not probed if the last probe was less than 'min_poll' ago.
431
the 'reachable' sites are probed twice daily and the 'unreachable'
432
sites are probed at most six times a day.
434
The default 'min_poll' is '1h' (1 hour).
435
The default 'max_poll' is '4h' (4 hours).
436
.Sh "min_sync \fItime-spec\fP"
437
.IX Subsection "min_sync time-spec"
438
Optionally specify how often the mirrors are required to make an update.
440
The default 'min_sync' is '1d' (1 day).
441
.Sh "max_sync \fItime-spec\fP"
442
.IX Subsection "max_sync time-spec"
443
Optionally specify the maximum allowable sync interval.
445
Sites exceeding the limit will be considered 'old'.
446
The default 'max_sync' is '2d' (2 days).
448
.IX Subsection "no_randomize"
449
To balance the probe load over the hourly mirmon runs,
450
mirmon may probe a few extra randomly choosen mirrors :
451
.IP "* only if the the number of mirrors to probe is below average," 4
452
.IX Item "only if the the number of mirrors to probe is below average,"
454
.IP "* at most 2% of the mirrors" 4
455
.IX Item "at most 2% of the mirrors"
458
If you don't want this behaviour, use \fBno_randomize\fR.
460
.IX Subsection "no_add_slash"
461
If the url part of a line in the mirror_list doesn't end
462
in a slash ('/'), mirmon adds a slash and issues a warning
463
unless it is in quiet mode.
465
If you don't want this behaviour, use \fBno_add_slash\fR.
466
.Sh "list_style plain|apache"
467
.IX Subsection "list_style plain|apache"
468
Optionally specify the format ('plain' or 'apache') of the mirror\-list.
470
See the description of 'mirror_list' above.
471
The default list_style is 'plain'.
472
.Sh "site_url \fIsite\fP \fIurl\fP"
473
.IX Subsection "site_url site url"
474
Optionally specify a substitute url for a site.
476
When access to a site is restricted (in Australia, for instance),
477
another (sometimes secret) url can be used to probe the site.
478
The <site> of an url is the part between '://' and the first '/'.
479
.Sh "env \fIkey\fP \fIvalue\fP"
480
.IX Subsection "env key value"
481
Optionally specify an environment variable.
482
.Sh "include \fIfile-name\fP"
483
.IX Subsection "include file-name"
484
Optionally specify a file to include.
486
The specified file is processed 'in situ'. After the specified file is
487
read and processed, config processing is resumed in the file where the
488
\&\f(CW\*(C`include\*(C'\fR was encountered.
489
The include depth is unlimited. However, it is a fatal error to
490
include a file twice under the same name.
492
.IX Subsection "show"
493
When the config processor encounters the 'show' command, it
494
dumps the content of the current config to standout, if option
495
\&\f(CW\*(C`\-v\*(C'\fR is specified. This is intented for debugging.
497
.IX Subsection "exit"
498
When the config processor encounters the 'exit' command, it
499
terminates the program. This is intented for debugging.
500
.SH "STATE FILE FORMAT"
501
.IX Header "STATE FILE FORMAT"
502
The state file consists of lines; one line per site.
503
Each line consists of white space separated fields.
504
The seven fields are :
505
.IP "* field 1 : url" 4
506
.IX Item "field 1 : url"
507
The url as given in the mirror list.
508
.IP "* field 2 : age" 4
509
.IX Item "field 2 : age"
510
The mirror's timestamp found by the last succesful probe,
511
or 'undef' if no probe was ever successful.
512
.IP "* field 3 : status last probe" 4
513
.IX Item "field 3 : status last probe"
514
The status of the last probe, or 'undef' if the mirror was never probed.
515
.IP "* field 4 : time last succesful probe" 4
516
.IX Item "field 4 : time last succesful probe"
517
The timestamp of the last succesful probe or 'undef'
518
if the mirror was never successfully probed.
519
.IP "* field 5 : probe history" 4
520
.IX Item "field 5 : probe history"
521
The probe history is a list of 's' (for success) and 'f' (for failure)
522
characters indicating the result of the probe. New results are appended
523
whenever the mirror is probed.
524
.IP "* field 6 : state history" 4
525
.IX Item "field 6 : state history"
526
The state history consists of a timestamp, a '\-' char, and a list of
527
chars indicating a past status: 's' (fresh), 'b' (oldish), 'f' (old),
528
\&'z' (bad) or 'x' (skip).
529
The timestamp indicates when the state history was last updated.
530
The current status of the mirror is determined by the mirror's age and
531
a few configuration parameters (min_sync, max_sync, max_poll).
532
The state history is updated when the mirror is probed.
533
If the last update of the history was less than 24 hours ago,
534
the last status is replaced by the current status.
535
If the last update of the history was more than 24 hours ago,
536
the current status is appended to the history.
537
One or more 'skip's is inserted, if the timestamp is two or more days old
538
(when mirmon hasn't run for more than two days).
539
.IP "* field 7 : last probe" 4
540
.IX Item "field 7 : last probe"
541
The timestamp of the last probe, or 'undef' if the mirror was never probed.
543
.IX Header "INSTALLATION"
545
.IX Subsection "general"
546
.IP "* Note: The (empty) state file must exist before mirmon runs." 4
547
.IX Item "Note: The (empty) state file must exist before mirmon runs."
549
.IP "* The mirmon repository is here :" 4
550
.IX Item "The mirmon repository is here :"
553
\& https://subversion.cs.uu.nl/repos/staff.henkp.mirmon/trunk/
555
.IP "* The mirmon tarball is here :" 4
556
.IX Item "The mirmon tarball is here :"
558
\& http://people.cs.uu.nl/henkp/mirmon/mirmon.tar.gz
560
.Sh "installation suggestions"
561
.IX Subsection "installation suggestions"
562
To install and configure mirmon, take the following steps :
563
.IP "* First, make the webdir :" 2
564
.IX Item "First, make the webdir :"
570
For \fI\s-1DOCUMENTROOT\s0\fR, substitute the full pathname
571
of the document root of your webserver.
572
.IP "* Check out the mirmon repository :" 2
573
.IX Item "Check out the mirmon repository :"
576
\& svn checkout REPO mirmon
582
\& REPO = https://subversion.cs.uu.nl/repos/staff.henkp.mirmon/trunk/
585
or download the package and unpack it.
586
.IP "* Chdir to directory mirmon :" 2
587
.IX Item "Chdir to directory mirmon :"
591
.IP "* Create the (empty) state file :" 2
592
.IX Item "Create the (empty) state file :"
596
.IP "* Install the icons in the webdir :" 2
597
.IX Item "Install the icons in the webdir :"
599
\& mkdir DOCUMENTROOT/mirmon/icons
600
\& cp icons/* DOCUMENTROOT/mirmon/icons
602
.ie n .IP "* Create a mirror list ""mirror_list"" ;" 2
603
.el .IP "* Create a mirror list \f(CWmirror_list\fR ;" 2
604
.IX Item "Create a mirror list mirror_list ;"
605
Use your favorite editor, or genererate the list from an
609
\& nl http://archive.cs.uu.nl/your-project/ contact@cs.uu.nl
610
\& uk http://mirrors.this.org/your-project/ mirrors@this.org
611
\& us http://mirrors.that.org/your-project/ mirrors@that.org
614
The email addresses are optional.
615
.ie n .IP "* Create a mirmon config file ""mirmon.conf"" with your favorite editor." 2
616
.el .IP "* Create a mirmon config file \f(CWmirmon.conf\fR with your favorite editor." 2
617
.IX Item "Create a mirmon config file mirmon.conf with your favorite editor."
619
\& # lines must start in the first column ; no leading white space
622
\& mirror_list mirror_list
624
\& countries countries.list
625
\& web_page DOCUMENTROOT/mirmon/index.html
626
\& icons /mirmon/icons
627
\& probe /usr/bin/wget -q -O - -T %TIMEOUT% -t 1 %URL%TIME
630
This assumes the project's timestamp is in file \f(CW\*(C`TIME\*(C'\fR.
631
.IP "* If you have rsync urls, change the probe line to :" 2
632
.IX Item "If you have rsync urls, change the probe line to :"
634
\& probe perl /usr/local/src/mirmon/probe -t %TIMEOUT% %URL%TIME
636
.IP "* Run mirmon :" 2
637
.IX Item "Run mirmon :"
639
\& perl mirmon -v -get all
642
The mirmon report should now be in 'DOCUMENTROOT/mirmon/index.html'
645
\& http://www.your.project.org/mirmon/
647
.IP "* If/when, at a later date, you want to upgrade mirmon :" 2
648
.IX Item "If/when, at a later date, you want to upgrade mirmon :"
650
\& cd /usr/local/src/mirmon
655
.IX Header "SEE ALSO"
661
\& (c) 2003-2011 Henk P. Penning
662
\& Computer Science Department, Utrecht University
663
\& http://people.cs.uu.nl/henkp/ -- penning@cs.uu.nl
664
\& mirmon-2.4 - Mon Jan 17 18:14:46 2011 ; henkp