Checking a Ping reply with a time index for Linux and Windows Boxes

Linux

 ping www.google.com | while read pong; do echo "$(date): $pong"; done  

Windows

@echo off
:loop
ping -n 1 %1 >nul || echo %date% %time% no reply from %1 >> pinglog.txt
choice /N /T 1 /D Y >nul
goto loop

Leave a Reply

Your email address will not be published. Required fields are marked *