I’m doing the script below and sending a Pushover message when any one fails.
Is there a way to assign the result to variable or to a message so I know WHICH IP failed?
@echo off
ping -n 5 192.168.20.200 | findstr /r /c:"[0-90] *ms"
ping -n 5 192.168.20.201 | findstr /r /c:"[0-90] *ms"
ping -n 5 192.168.20.202 | findstr /r /c:"[0-90] *ms"
ping -n 5 192.168.20.203 | findstr /r /c:"[0-90] *ms"
ping -n 5 192.168.20.204 | findstr /r /c:"[0-90] *ms"
if %errorlevel% == 0 (
EXIT 0
) else (
EXIT 1
)