Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- echo === DNS and LAN connectivity monitoring started : %date% %time% ===
- echo === DNS and LAN connectivity monitoring started : %date% %time% === >> dc.txt
- :int
- ping 8.8.8.8 -n 1 > NUL &rem This IP is Google's DNS server, replace it by the one you need to test
- if %errorlevel% EQU 0 (
- set global=1
- ) else (
- set global=0
- )
- ping 192.168.1.1 -n 1 > NUL &rem Replace this IP by your router address
- if %errorlevel% EQU 0 (
- set local=1
- ) else (
- set local=0
- )
- ping -n 4 127.0.0.1 >nul &rem only used as a 4s delay
- if %global% EQU 0 (
- if %local% EQU 1 (
- echo DNS Dysfunction : %date% %time%
- echo DNS Dysfunction : %date% %time% >> dc.txt
- )
- )
- if %local% EQU 0 (
- echo LAN Dysfunction : %date% %time%
- echo LAN Dysfunction : %date% %time% >> dc.txt
- )
- if %global% EQU 1 (
- echo OK : %date% %time%
- )
- goto int
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement