Ping Monitor is a batch script which can run from DOS command line as a .BAT. Specify target IP, delay time and log file name. Copy lines below and save as ping-monitor.bat.
@echo off
setlocal
if “%~1″==”” (
echo Usage: %~nx0 HOST_OR_IP [INTERVAL_SECONDS] [LOG_FILE]
echo Example: %~nx0 192.168.1.1 3 ping-log.txt
exit /b 1
)
set “TARGET=%~1”
set “INTERVAL=%~2”
if not defined INTERVAL set “INTERVAL=3”
set “LOG=%~3”
if not defined LOG set “LOG=ping-log.txt”
echo Logging pings to “%LOG%”. Press Ctrl+C, then Y, to stop.
:loop
echo [%date% %time%] Pinging %TARGET%…
>>”%LOG%” echo [%date% %time%] Pinging %TARGET%
ping -n 1 -w 1000 “%TARGET%” >>”%LOG%”
>>”%LOG%” echo.
timeout /t %INTERVAL% /nobreak >nul
goto loop
##
Example test where I unplugged a cable and reconnected it (STP added a delay of about 1 minute as it went through learning process)…
c:\tmp>ping-monitor 192.168.0.198 5 ping-log.txt
Logging pings to “ping-log.txt”. Press Ctrl+C, then Y, to stop.
[29/09/2026 9:31:16.02] OK – 192.168.0.198
[29/09/2026 9:31:21.12] OK – 192.168.0.198
[29/09/2026 9:31:26.17] LOST – 192.168.0.198
[29/09/2026 9:31:32.11] LOST – 192.168.0.198
[29/09/2026 9:31:37.19] LOST – 192.168.0.198
[29/09/2026 9:31:43.11] LOST – 192.168.0.198
[29/09/2026 9:31:48.19] LOST – 192.168.0.198
[29/09/2026 9:31:54.21] LOST – 192.168.0.198
[29/09/2026 9:32:00.11] LOST – 192.168.0.198
[29/09/2026 9:32:05.16] LOST – 192.168.0.198
[29/09/2026 9:32:11.11] LOST – 192.168.0.198
[29/09/2026 9:32:16.18] OK – 192.168.0.198
[29/09/2026 9:32:21.13] OK – 192.168.0.198
[29/09/2026 9:32:26.13] OK – 192.168.0.198
Terminate batch job (Y/N)? y