Skip to main content

How to Monitor Network With Windows Script

Published 1 min readMarkdown
Part of seriesNetworking
How to Monitor Network With Windows Script

အားလုံးပဲ မင်္ဂလာပါ။ ဒီနေ့မှာတော့ Windows Bat File ကို သုံးပြီးတော့ Network Monitoring script လေး ရေးပြသွားမှာဖြစ်ပါတယ်။

အရင်ဆုံး ကျွန်တော်တို့ Text Document အလွတ်တစ်ခု Create လုပ်ပါမယ်။ ပြီးရင် ကျွန်တော် command လေး ထည့်ပါမယ်။ Command ကို အောက်မှာ copy ယူပါ။

@echo off & cls

set IP=8.8.8.8

:top

PING -n 1 %IP% | FIND "TTL="

IF ERRORLEVEL 1 (
    SET OUT=4F
    echo Request timed out.
) ELSE (
    SET OUT=2F
)

color %OUT%

ping -n 2 -w 1000 127.0.0.1 >nul

GoTo top

set IP = 8.8.8.8 နေရာမှာ ကိုယ် Ping ထားချင်တဲ့ Server IP ဒါမှမဟုတ် Website (amazonaws.com) စသဖြင့် ကိုယ်ထားချင်တဲ့ဟာကို ပြောင်းထားလို့ရပါတယ်။


ပြီးရင် ကျွန်တော်တို့ Text File လေးကို Save ပါမယ်။ Save တဲ့အခါ bat file အနေနဲ့ Extension ပြောင်းပြီး save ပေးရပါမယ်။

ဒီ ping.bat File လေးကို Double Click or Run As Administrator နှိပ်ပြီး Run လိုက်မယ်ဆိုရင်

reply ပြန်ရင် Background က စိမ်းနေမှာဖြစ်ပြီး

reply မပြန်ရင် Background က အနီရောင်ဖြစ်နေမှာပါ။

Ping ပြန်မိသွားရင်တော့ Background က ပြန်စိမ်းလာမှာပဲဖြစ်ပါတယ်။


ဒီ Tips & Trick လေးက လွယ်ကူပြီး ရိုးရှင်းတဲ့အတွက် အသုံးတည့်မယ်လို့ မျှော်လင့်ပါတယ်။ အားလုံးပဲ အချိန်ပေးပြီး ဖတ်ရှုပေးတဲ့အတွက်လဲ ကျေးဇူးတင်ပါတယ် ခင်ဗျ။

Author By PoneMyat

About the author

  • I have over 6 years of experience in IT industry related to Systems and Network. I have been managing data centers with a focus on both on-premise and cloud servers.

More from this blog