Generating 348 ping probes from a whois dump
A column-aligned whois dump became 15,311 lines of cloudprober config, and the interesting part is how the lines get split.
The input is a whois dump, three columns wide, aligned with spaces. Every address a partner's local-breakout proxies talk to is in it:
198.51.100.56 LBO9 <operator name>
198.51.100.57 LBO9 <operator name>
coding/cloudprober-conf-from-whois.py is 87 lines and turns each row into one cloudprober
probe. The commit that added it (6af3bb2, 10 July 2025) committed the output too — 15,311
lines of config, one probe { } block per address.
Split on the separator, not on whitespace
The whole script rests on one line:
parts = re.split(r'\t+|\s{2,}', line.strip())
Tabs, or two-or-more spaces. The obvious thing is bare split(), and it is wrong here. The
third column is a registered operator name, and operator names contain single spaces. Split
on any whitespace and one operator becomes three fields; every probe after it carries a
shifted label.
Column three is also sometimes blank. The operator name then falls back to the short name in
column two (parts[2] if len(parts) >= 3 ... else short_name), and a row with fewer than
two fields is skipped instead of half-rendered.
Each probe carries six labels — ip_dest, ip_dest_addr, ip_src, ip_src_addr,
probe_name, partner. A latency series with one end named (the destination) is useless. Knowing the
destination tells you something is slow; it does not tell you which of the four proxies to
look at.
The probe binds its source address
external_probe {
mode: ONCE
command: "ping -c 1 -q -I 203.0.113.100 <ip>"
}
That -I is why these are EXTERNAL probes and not cloudprober's own ping (which has no
source-bind option). The host is
multi-homed (one internal address, one partner-facing address). The route the packet takes
is the thing being measured. Leave -I off and the kernel picks for you; it picks the
internal interface, so the probe goes green while the path under test stays untested.
Interval and timeout are both 30 seconds (interval_msec: 30000, timeout_msec: 30000).
For an external command that is deliberate: a probe still waiting when the next one is due
has already failed.
A wrapper nothing calls
The same commit added coding/ping-wrapper.sh (nine lines). It greps the RTT out of ping's
summary line and prints cloudprober's external payload format:
echo "success=1 latency=${RTT}"
The generated config calls bare ping (no wrapper, no parsing). So cloudprober times the whole invocation itself,
process spawn included, instead of reading the round trip ping already measured. On a sub-5ms
path that is a few milliseconds of overhead reported as latency; the wrapper that fixes it
has sat in the tree unused since the day it landed.
The region sweep
coding/aws_latency_tester.sh (829bd1a, 7 July, 47 lines) answers a different question:
where should a proxy live. It walks 33 AWS regions, resolves s3.<region>.amazonaws.com,
takes the first address, and pings it ten times for min/avg/max/mdev.
host="s3.${region}.amazonaws.com"
IPs=$(dig +short @"$DNS_SERVER" "$host" | grep -Eo '^[0-9.]+$')
dig is the primary and nslookup the fallback. The script runs on a laptop and on a
production host, and only one of the two ships dig. Resolving S3 instead of something
inside the region's own network is a deliberate cheat — one hostname pattern covers all 33
regions, with an account in none of them.
First-address-only (head -n 1) is the honest limitation. S3 resolves to a rotating set, so two runs an
hour apart can measure two different front ends. The numbers rank regions against each other;
they say little about how one region moves over a week.
What it leaves undone
Neither script knows anything about inventory — no NetBox lookup, no API call, nothing that would notice a change. The whois dump is produced by hand, and so is every regeneration of the probe set. An address a partner adds goes unmonitored until someone re-runs both. The address list moves a few times a year (which is why this was acceptable), and it is the first thing that would have to go if it started moving weekly.