commit: c830c7267db4b8ed88e440a39e75768a20fd9fa0 Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> AuthorDate: Tue Apr 28 17:29:31 2020 +0000 Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> CommitDate: Tue Apr 28 17:29:31 2020 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=c830c726
snapshots: also test this Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> mirmon-snapshots.sh | 18 ++++++++++++++++++ snapshots_mirrors/mirmon.conf | 23 +++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh new file mode 100644 index 0000000..692a1ef --- /dev/null +++ b/mirmon-snapshots.sh @@ -0,0 +1,18 @@ +#!/bin/bash + +cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors +# Grab mirrors from the web +[[ -d ./var ]] || mkdir ./var +../get-mirrors-from-distfiles-xml.rb > ./var/g.mirrors +# fatal if the state file is NOT present. +[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state +# run mirmon +/usr/bin/perl ../../mirmon/mirmon -c ./mirmon.conf -q -get update +# Set up a nice link to our mirror page directly: +[[ -d ../../htdocs/snapshots ]] || mkdir ../../htdocs/snapshots +sed \ + -e 's#mirrors</H2>#<a href="http://www.gentoo.org/main/en/mirrors2.xml">mirrors</a></H2>#' \ + >../../htdocs/snapshots/index.html <../../htdocs/snapshots/index-wip.html +# Generate a json file containing the state of each mirror +../json/generate-json.py /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors/var/mirmon.state \ + > ../../htdocs/snapshots/state.json diff --git a/snapshots_mirrors/mirmon.conf b/snapshots_mirrors/mirmon.conf new file mode 100644 index 0000000..6d689bb --- /dev/null +++ b/snapshots_mirrors/mirmon.conf @@ -0,0 +1,23 @@ +project_name Gentoo Linux (snapshots) +web_page /var/www/mirrorstats.gentoo.org/htdocs/snapshots/index-wip.html +icons ../icons +countries /var/www/mirrorstats.gentoo.org/mirmon/countries.list +mirror_list /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors/var/g.mirrors +state /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors/var/mirmon.state +probe /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/probe-mirmon %TIMEOUT% %URL%snapshots/.timestamp-snapshots.x +project_url http://www.gentoo.org/ +project_logo http://www.gentoo.org/images/gentoo-new.gif + + +# Fresh: 0 - 8h +# Oldish: 8 - 24h +# Old: 24h - inf +# Bad: No reachable, no state saved + +max_poll 4h +min_sync 4h +max_sync 20h + +put_histo top +timeout 30 +