1 |
commit: c830c7267db4b8ed88e440a39e75768a20fd9fa0 |
2 |
Author: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Apr 28 17:29:31 2020 +0000 |
4 |
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Apr 28 17:29:31 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/gentoo-mirrorstats.git/commit/?id=c830c726 |
7 |
|
8 |
snapshots: also test this |
9 |
|
10 |
Signed-off-by: Robin H. Johnson <robbat2 <AT> gentoo.org> |
11 |
|
12 |
mirmon-snapshots.sh | 18 ++++++++++++++++++ |
13 |
snapshots_mirrors/mirmon.conf | 23 +++++++++++++++++++++++ |
14 |
2 files changed, 41 insertions(+) |
15 |
|
16 |
diff --git a/mirmon-snapshots.sh b/mirmon-snapshots.sh |
17 |
new file mode 100644 |
18 |
index 0000000..692a1ef |
19 |
--- /dev/null |
20 |
+++ b/mirmon-snapshots.sh |
21 |
@@ -0,0 +1,18 @@ |
22 |
+#!/bin/bash |
23 |
+ |
24 |
+cd /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors |
25 |
+# Grab mirrors from the web |
26 |
+[[ -d ./var ]] || mkdir ./var |
27 |
+../get-mirrors-from-distfiles-xml.rb > ./var/g.mirrors |
28 |
+# fatal if the state file is NOT present. |
29 |
+[[ -e ./var/mirmon.state ]] || touch ./var/mirmon.state |
30 |
+# run mirmon |
31 |
+/usr/bin/perl ../../mirmon/mirmon -c ./mirmon.conf -q -get update |
32 |
+# Set up a nice link to our mirror page directly: |
33 |
+[[ -d ../../htdocs/snapshots ]] || mkdir ../../htdocs/snapshots |
34 |
+sed \ |
35 |
+ -e 's#mirrors</H2>#<a href="http://www.gentoo.org/main/en/mirrors2.xml">mirrors</a></H2>#' \ |
36 |
+ >../../htdocs/snapshots/index.html <../../htdocs/snapshots/index-wip.html |
37 |
+# Generate a json file containing the state of each mirror |
38 |
+../json/generate-json.py /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors/var/mirmon.state \ |
39 |
+ > ../../htdocs/snapshots/state.json |
40 |
|
41 |
diff --git a/snapshots_mirrors/mirmon.conf b/snapshots_mirrors/mirmon.conf |
42 |
new file mode 100644 |
43 |
index 0000000..6d689bb |
44 |
--- /dev/null |
45 |
+++ b/snapshots_mirrors/mirmon.conf |
46 |
@@ -0,0 +1,23 @@ |
47 |
+project_name Gentoo Linux (snapshots) |
48 |
+web_page /var/www/mirrorstats.gentoo.org/htdocs/snapshots/index-wip.html |
49 |
+icons ../icons |
50 |
+countries /var/www/mirrorstats.gentoo.org/mirmon/countries.list |
51 |
+mirror_list /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors/var/g.mirrors |
52 |
+state /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/snapshots_mirrors/var/mirmon.state |
53 |
+probe /var/www/mirrorstats.gentoo.org/gentoo-mirrorstats/probe-mirmon %TIMEOUT% %URL%snapshots/.timestamp-snapshots.x |
54 |
+project_url http://www.gentoo.org/ |
55 |
+project_logo http://www.gentoo.org/images/gentoo-new.gif |
56 |
+ |
57 |
+ |
58 |
+# Fresh: 0 - 8h |
59 |
+# Oldish: 8 - 24h |
60 |
+# Old: 24h - inf |
61 |
+# Bad: No reachable, no state saved |
62 |
+ |
63 |
+max_poll 4h |
64 |
+min_sync 4h |
65 |
+max_sync 20h |
66 |
+ |
67 |
+put_histo top |
68 |
+timeout 30 |
69 |
+ |