This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
Hello,
I've been trying to deal with an issue where a certain site has a pool of IPs, and when it hits a certain one it doesn't load the data for us. We are trying to show more information with IP's that work, and the IP(s) that don't.
Is it possible to get the IP and output it from "Ping statistics for xxx.xxx.xxx.xxx?
I found a batch script and modified it a little to get date/time stamps, below is the script.
Example of what I'd want is to check google.com and the output gives me something like "Link is up - Thu 06/16/2022 7:55:23.20 google.com (ip address here)"
u/setlocal enableextensions enabledelayedexpansion
u/echo off
set ip=%1
:loop
set state=down
for /f "tokens=5,6,7" %%a in ('ping -n 1 !ip!') do (
if "x%%b"=="xunreachable." goto :endloop
if "x%%a"=="xReceived" if "x%%c"=="x1," set state=up
)
:endloop
echo.Link is !state! - ๏ฟฝte% %time% !ip!
ping -n 60 127.0.0.1 >nul: 2>nul:
goto :loop
endlocal
Post Details
- Posted
- 2 years ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/Batch/comme...