Many software projects are mirrored worldwide. The mirror sites are required to update the mirror archive regularly (daily, weekly) from a root server.Mirmon helps administrators in keeping an eye on the mirror sites. In a concise graphic format, mirmon shows each site's status history of the last two weeks. It is easy to spot stale or dead mirrors.
Every hour the root site writes a fresh timestamp somewhere in the archive; mirror sites copy this timestamp when they update the mirror archive. Mirmon periodically retrieves these timestamps from the mirror sites. It generates a html report and a flat state file.Mirmon's actions and report are directed by a config file. There are many configuration parameters, but most have acceptable defaults. Only a few project specific items need to be specified. Once configured, mirmon can be run by cron every hour. Mirror sites are probed at certain (user defined) intervals (default every 4 hours). Sites that are (temporarily) unreachable are probed more often (by default hourly) until a probe is successful.
A Perl module Mirmon.pm is included in the package. This module makes it easy to create applications like : mailing admins of stale mirrors, directing users to fresh mirrors, etc.
svn relocate NEW
or svn switch --relocate OLD NEW
with
OLD = https://subversion.cs.uu.nl/repos/staff.henkp.mirmon NEW = https://svn.science.uu.nl/repos/project.mirmon
Apparent limitations of mirmon can usualy be overcome by using a smarter probe, that is smarter than plain wget or curl.case 1 : a different TIMESTAMP format
Mirmon expects the probe to deliver a line starting with something like a timestamp :1189065601This is easy if the TIMESTAMP files on the mirrors contain just that. In the mirmon config file, the probe can be specified asprobe /usr/bin/wget -q -O - -t 1 %URL%TIMESTAMPIf however, the TIMESTAMP files are in a date-like formatThu Sep 6 08:00:01 UTC 2007the probe has to be a little smarter and convert dates to timestamps :probe /usr/bin/wget -q -O - -t 1 %URL%TIMESTAMP | date --file - +%scase 2 : probing rsync sites
Suppose you would like to use mirmon to monitor rsync sites. Simply using wget or curl won't do, because rsync isn't suported in the way you want.The solution is to roll your own smarter probe. Write a small Perl program that interprets rsync-urls, and retrieves the TIMESTAMP files by rsync.
In the mirror_list, specify a mirror like:
us rsync://rsync.apache.org/apache-dist/Basically, the perl program has toIncluded in the mirmon distro is a sample program probe, that handles ftp, http and rsync urls.
- parse the given url and determine the remote file:
$remote = "rsync.apache.org::apache-dist/TIMESTAMP" ;- invent the name for a local copy of the TIMESTAMP file
$local = "/tmp/mirmon/rsync.apache.org__apache-dist" ;Note that several probes my be running in paralel, so you can't use a `fixed' name.
- retrieve the timestamp file :
system "/local/bin/rsync $remote $local" ;- output the content of file $local (if any)
@ARGV = ($local) ; print <> ;