# HG changeset patch # User Daniel O'Connor # Date 1656906538 -34200 # Node ID 1a87c79cf103933472cff9ba0ea7183e9619fd42 # Parent 6f85bedf99662001b7e8318e585be99bd947b605 Handle new ping which does IPv6 (and spells stddev as std-dev!) diff -r 6f85bedf9966 -r 1a87c79cf103 speedcheck.py --- a/speedcheck.py Wed Dec 02 11:19:50 2020 +1030 +++ b/speedcheck.py Mon Jul 04 13:18:58 2022 +0930 @@ -80,8 +80,12 @@ if len(l) != 6: print('Unable to parse ping line:', l) xx, xx, xx, plossline, latline, xx = l - ploss = float(re.match('.* received, ([0-9.]+)% packet loss', plossline).groups()[0]) - latency = float(re.match('.*stddev = [0-9.]+/([0-9.]+)/.* ms', latline).groups()[0]) + ploss = re.match('.* received, ([0-9.]+)% packet loss', plossline) + if ploss is not None: + ploss = float(ploss.groups()[0]) + latency = re.match('.*std-?dev = [0-9.]+/([0-9.]+)/.* ms', latline) + if latency is not None: + latency = float(latency.groups()[0]) return ploss, latency def createrrd(rrdname):