summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2020-04-28 10:29:31 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2020-04-28 10:29:31 -0700
commitc830c7267db4b8ed88e440a39e75768a20fd9fa0 (patch)
tree964be75b85c7a33a3fe378dd7f1f97b01e5a1f55
parentrefactor mirror list generation (diff)
downloadgentoo-mirrorstats-c830c7267db4b8ed88e440a39e75768a20fd9fa0.tar.gz
gentoo-mirrorstats-c830c7267db4b8ed88e440a39e75768a20fd9fa0.tar.bz2
gentoo-mirrorstats-c830c7267db4b8ed88e440a39e75768a20fd9fa0.zip
snapshots: also test this
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rw-r--r--mirmon-snapshots.sh18
-rw-r--r--snapshots_mirrors/mirmon.conf23
2 files changed, 41 insertions, 0 deletions
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
+