1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
@echo off set nom=VULCANO set dip=20.210.75.150 set out=C:\SNMP-monitoreo\offline\ :comienzo for /f "tokens=1-4 delims=- " %%a in ('date/t') do (set dia=%%a& set mes=%%b& set ano=%%c) set fecha=%dia%-%mes%-%ano% SET hor=%TIME:~,2% SET min=%TIME:~3,2% SET seg=%TIME:~6,2% set hora=%hor%:%min% set dip0=0 set dip1=0 :consulta if exist %out%%dip% set dip0=1 ping %dip% -w 700 2>nul | find "TTL=" >NUL || set dip1=1 if %dip0%==0 if %dip1%==0 (goto :salida) if %dip0%==1 if %dip1%==0 (del /f /q %out%%dip% goto :salida) echo %nom% > %out%%dip% :salida exit |