#!/usr/local/bin/perl -w
##################################################################
# $Id$
# mrtg-ping-probe release $Name:  $
#
# Copyright (c) 1997 by Peter W. Osel <pwo@guug.de>, Cupertino.
# All Rights Reserved.
#
# See the file COPYRIGHT in the distribution for the exact terms.
#
##################################################################
# testfile to test regular expression matching
# do we catch all different formats?
# ToDo: automatically verify correvt extraction.
##################################################################

while (<DATA>) {
	s/^\s*#.*$//;		# Strip comment
	next if /^\s*$/;	# Skip empty lines

	print "min: $1, avg: $2, max: $3\n"
		if m|^round-trip(?: \(ms\) )? min/avg/max = (\d+)(?:\.\d+)?/(\d+)(?:\.\d+)?/(\d+)(?:\.\d+)?|;
	}


__DATA__

# SunOS speedy 5.5 Generic sun4u sparc SUNW,Ultra-1
# /usr/sbin/ping host [timeout]
# /usr/sbin/ping -s[drvRlLn] [-I interval] [-t ttl] [-i interface] host [data size] [npackets]

round-trip (ms)  min/avg/max = 175/176/178


# SunOS asterix 4.1.4 2 sun4m
# /usr/etc/ping host [timeout]
# /usr/etc/ping -s[drvRl] host [data size] [npackets]

round-trip (ms)  min/avg/max = 174/177/184


# HP-UX prisma A.09.03 A 9000/735 2003425300 two-user license
# /etc/ping [-drvo] host [packet size] [npackets]

round-trip (ms)  min/avg/max = 3/4/6


# AIX
# /etc/ping

round-trip min/avg/max = 3/4/18 ms


# Linux floyd 1.99.4 #2-pre-2.0 Fri Aug 23 10:08:15 MET DST 1996 i486
# /etc/ping [-LRdfnqrv] [-c count] [-i wait] [-l preload]
#	[-p pattern] [-s packetsize] [-t ttl] [-I interface address] host

round-trip min/avg/max = 333.5/386.6/429.2 ms


# BSD/OS epiphore 2.1 BSDI BSD/OS 2.1
# /bin/ping [-dfnqRrv] [-c count] [-i wait] [-l preload]
#	[-p pattern] [-s packetsize] host

round-trip min/avg/max = 10.25/50.253/100.256 ms


# FreeBSD host.domain 2.2.1-RELEASE FreeBSD 2.2.1-RELEASE #0: Friday May 2 21:27:07 LKT 1997     root@host.domain:/usr/src/sys/compile/SLT  i386
# usage: ping [-LQRadfnqrv] [-c count] [-i wait] [-I interface]
#	[-l preload] [-p pattern] [-s packetsize] [-T ttl] host

round-trip min/avg/max = 3.216/5.898/26.582 ms


# SGI IRIX 6.2
# /usr/etc/ping [-dfnqrvRL] [-c count] [-s size] [-l preload]
#		[-i interval] [-p pattern] [-T ttl] [-I addr] host


