Ping VPN List of Servers - Output Avg Response Time

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
azmedia
Posts: 2
Joined: 02 Aug 2016 15:42

Ping VPN List of Servers - Output Avg Response Time

#1 Post by azmedia » 02 Aug 2016 15:50

I have rudimentary skills with batch files, nearly 60 yers old. I'm trying to find the fastest server within my VPN provider. So using a servers.txt list of 15-20 servers like this:
lax-a03.ipvanish.com
lax-a04.ipvanish.com
lax-a05.ipvanish.com
lax-a06.ipvanish.com.......

I'm trying to get the "Average" round trip response time of each server and have that output to a "results.txt" file.
This data is in the last line of ping results (Minimum = 21ms, Maximum = 25ms, Average = 23ms)

I have found many batch files that ping a server but they are checking for connection status, or generate the IP, for just one server, or something other than ms response time. Any help would be appreciated.

This is all I found that would use a list. However, it doesn't produce results to a file or produce the response time (ms).

for /f %%i in (servers.txt) do ping %%i

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: Ping VPN List of Servers - Output Avg Response Time

#2 Post by foxidrive » 03 Aug 2016 06:48

azmedia wrote:I'm trying to get the "Average" round trip response time of each server and have that output to a "results.txt" file.
This data is in the last line of ping results (Minimum = 21ms, Maximum = 25ms, Average = 23ms)



Test this:

Code: Select all

@echo off
(
   for %%a in (
lax-a03.ipvanish.com
lax-a04.ipvanish.com
lax-a05.ipvanish.com
lax-a06.ipvanish.com
   ) do (
            echo pinging %%a 1>&2
            echo %%a
            ping %%a -n 10 |find "Average ="
   )
)>"logfile.txt"

azmedia
Posts: 2
Joined: 02 Aug 2016 15:42

Re: Ping VPN List of Servers - Output Avg Response Time

#3 Post by azmedia » 06 Aug 2016 21:26

foxidrive - thank you so much. This is excellent, much better than creating a txt list of servers to feed the batch file. Thanks again!!!!

Post Reply