MikroTik Tutorial 72 - Monitor network links using Netwatch

Поделиться
HTML-код
  • Опубликовано: 8 ноя 2024
  • Learn MikroTik RouterOs Tutorial Series (english)
    In this tutorial I will show you how to monitor your network links using netwatch. This feature can be used to monitor your internet or local area connections.
    Script:
    /tool netwatch
    add down-script=":global myVarDownTime
    \

    :set myVarDownTime \"\$[/system clock get time]\"
    \

    :log error \"WAN link is down\"" host=8.8.8.8 up-script=":global myVarDo\
    wnTime
    \

    :log error \"WAN link is up again\"
    \

    /tool e-mail send to=\"YourEmailAddress@gmail.com\" subject=\"\$[/sy\
    stem identity get name] WAN Link is up on \$[/system clock get time]. Down\
    \_from \$myVarDownTime\""
    Mikrotik supported devices
    ---------------------------------------------
    RB951Ui-2nD,hAP
    RB3011UIAS-RM
    RB2011UiAS-2HnD-IN
    RB750Gr2
    hEX,RB750Gr3
    RB2011iLS-IN
    CRS109-8G-1S-2HnD-IN
    hAP lite
    hAP ac mAP
    wAP
    RB951Ui-2HnD
    RB951G-2HnD
    RB2011UiAS-2HnD-IN
    RB941-2nD-TC
    RB2011iL-RM
    RB2011UiAS-IN
    RB2011UiAS-RM
    RB1100AHx4
    CCR1009-7G-1C-PC
    CCR1009-7G-1C-1S+PC
    LDF 5
    SXTsq Lite5
    DISC Lite5
    SXT Lite2
    SXTsq 5 ac
    LHG 2
    Groove 52
    LHG 5
    LHG XL 2
    LHG HP5
    SXT 2
    LHG
    OmniTIK 5
    BaseBox
    wAP 60G,SEXTANT G
    OmniTIK 5
    mANTBox
    QRT
    DynaDish

Комментарии • 70

  • @AliMirjamali
    @AliMirjamali 6 лет назад +2

    Thank very much for the video. This was really useful. I added a global variable in "Down" script to store the time when the link goes down and reused it in "Up" script for e-mail notification.

    • @TKSJa
      @TKSJa  6 лет назад

      Cool, could you share your script?

    • @AliMirjamali
      @AliMirjamali 6 лет назад +2

      Sure. Here the script I used:
      /tool netwatch
      add down-script=":global myVarDownTime
      \

      :set myVarDownTime \"\$[/system clock get time]\"
      \

      :log error \"WAN link is down\"" host=8.8.8.8 up-script=":global myVarDo\
      wnTime
      \

      :log error \"WAN link is up again\"
      \

      /tool e-mail send to=\"ali.mirjamali@gmail.com\" subject=\"\$[/system id\
      entity get name] WAN Link is up on \$[/system clock get time]. Down from \
      \$myVarDownTime\""

    • @TKSJa
      @TKSJa  6 лет назад +1

      Thank for sharing. It works like a charm.

    • @DuskoMandic
      @DuskoMandic 2 года назад +1

      @@TKSJa doesn’t work anymore. They have changed permissions for Netwatch and now it can not set global variables or read them. Need to set scripts in system/scripts, have them with “Don’t require permissions” enabled and call them from Netwatch

    • @Stephen_M02
      @Stephen_M02 Год назад

      @@DuskoMandic Thanks so much for posting this - I was able to use this to implement an ISP downtime monitor, and really wanted it to be able to email me with the timestamp that it went down at, when it came back up.

  • @MSIZAR
    @MSIZAR 4 года назад +3

    Thank you for the video very helpful as always, the email shows = WAN Link is up on 22:38:51. Down from, How can i make it show the down time on the email ?

    • @AhmedAbbas76
      @AhmedAbbas76 2 года назад

      no way cuz there is no connection but it depends on your ping from outside to your firewall using your static ip if no replay so the link is down

  • @dimasfaqihuddin989
    @dimasfaqihuddin989 3 года назад

    very helpful, it is posibble if netwatch give notification on email by hourly while the host target still down ? , its kind like reminder , thanks

  • @formi7916
    @formi7916 3 года назад +1

    His videos worth a subscribe .. Thumbs up!

    • @TKSJa
      @TKSJa  3 года назад

      Thanks!

  • @AhmedAbbas76
    @AhmedAbbas76 2 года назад

    I think this method is useful for your internal servers to keep monitoring everything is UP and if one of your servers is down you will know that by checking your mail but it useless for testing your wan interface cuz you may have a tow or three wan interfaces

  • @Rouly88
    @Rouly88 6 лет назад +2

    I was looking for this Netwatch.. Tks à lot

    • @TKSJa
      @TKSJa  6 лет назад

      You are welcome

    • @breakena
      @breakena 6 лет назад

      TKSJa can i get a email address for you

  • @Answerx32
    @Answerx32 Год назад

    Don't you need to set up the Email server on the router to be able to send emails?

  • @muhammadjahirulislam8283
    @muhammadjahirulislam8283 4 года назад

    I have two WAN link from different ISP. So I have configured it PCC load balance with fail over. When my primary link getting down I want to get notification for this particular link. In this vedio you have configured to it using a single WAN link. How could i do this?

  • @lkfng
    @lkfng 6 лет назад

    Big up yourself sir, keep the videos coming.​

    • @TKSJa
      @TKSJa  6 лет назад

      You are welcome

  • @PinoyTechTutorials
    @PinoyTechTutorials 3 года назад

    You are wonderful!

  • @pakonline
    @pakonline 4 года назад

    nice video what i want to know is there any option we can create Nwatch Monitoring for specific interface as i have 3 Wan in my case ...Wan1 wan2 and wan3 i want if only wan 1 goes down then generate a log error or when its up then generate email is it possible ?

  • @seanyoung5978
    @seanyoung5978 6 лет назад +1

    Hi. Thanks for these tutorials, they have helped a lot. I would like to know how to setup a 3G USB modem for backup.

    • @geraldallaire9904
      @geraldallaire9904 6 лет назад

      Me too I would like to know how to setup a 3G USB modem for backup. on my RB2011UiAS-2HnD-IN

    • @TKSJa
      @TKSJa  6 лет назад

      You are welcome. I don't have a 3G modem, but you could take a look at this wiki.mikrotik.com/wiki/Category:3G

  • @johndeoresearch2251
    @johndeoresearch2251 4 года назад +1

    How can you send email when internet is down?

  • @saomaicns3201
    @saomaicns3201 4 года назад

    Mikrotik Team Việt Nam ơi, các bạn có thể làm chủ đề về các thông báo người quản trị khi có sự cố về mất đường wan, mất đường internet, người truy cập bất hợp pháp thành công vào router. Chủ đề về Netwach. Thanks

  • @lkfng
    @lkfng 6 лет назад

    Do you have any videos about how to set up​ a hotspot from scratch?

    • @TKSJa
      @TKSJa  6 лет назад +1

      Here is the Hotspot playlist
      ruclips.net/video/bH_6MS9T_n4/видео.html

  • @andikadioey4680
    @andikadioey4680 6 лет назад

    great i am using telegram and netwatch for monitoring, hope it will be on your next video :)

    • @TKSJa
      @TKSJa  6 лет назад

      I have never used telegram, hope you could share how you send messages from your router to telegram.

  • @srinivasareddysomireddy454
    @srinivasareddysomireddy454 5 лет назад

    It is Very Useful , Thanks

  • @luanboraj6350
    @luanboraj6350 6 лет назад

    hello friend I followed your guide to monitor the ADSL connection and an NSM5 antenna connected in the network that I use as AP, Mikrotik logs is seen when the connection is missing or when I remove the M5 but I receive no email (email setting OK tested) can you tell me where I'm wrong? I have pravo to write on Netwatch what you wrote but it does not go, I tried to load the script you put in the description for the terminal charging as incorrect, you can help me Thanks

  • @TKO67
    @TKO67 3 года назад

    breddren bigup

  • @mikrotikwarlock608
    @mikrotikwarlock608 5 лет назад

    very helful thank u so much

  • @pcplacegr
    @pcplacegr 6 лет назад +1

    Awesome! Very helpful man! One question! I am not getting the "from" time value... Do I have to change anything?

    • @TKSJa
      @TKSJa  6 лет назад +3

      I notice that it stop working since the last update. I will have to investigate.

  • @albaniannature9578
    @albaniannature9578 5 лет назад

    Can you help me with a script that will disable and enable dhcp client when the ping to 8.8.8.8 is down? thank you

  • @SBRTELECOMPVTLTDFarukhNagar
    @SBRTELECOMPVTLTDFarukhNagar 4 года назад

    Please Suggest SFP Port Down Alarm system in microtik Thankyou in Advance TKSJa

  • @0912642
    @0912642 5 лет назад +2

    When link is down how router send you mail???????

    • @S4Simple
      @S4Simple 5 лет назад

      Remove global variable since global variable in netwatch script will not be readable by scheduler or other users

  • @KhanSharief
    @KhanSharief 5 лет назад +1

    how can it send email when internet is down?

    • @S4Simple
      @S4Simple 5 лет назад

      It can send but remove global variable since they dont work in netwatch tool.

  • @jekk22
    @jekk22 6 лет назад +1

    Hello
    I'd like to integrate netwatch with telegram. you can tell me how to set it so that using the bot id I get the notification when the link goes down. thank you

    • @TKSJa
      @TKSJa  6 лет назад

      I have never used telegram.

    • @محمدالشرعبي-ظ5ث
      @محمدالشرعبي-ظ5ث 4 года назад

      You can use this replace the $$$$ by your bot token and @@@@ by your chat I'd and ???? The text you want
      /tool fetch url="api.telegram.org/bot$$$$$$$$$$$$$$$$$$/sendMessage?chat_id=@@@@@@@&text=?????" keep-result=no;

  • @gunchag
    @gunchag 3 года назад

    Is it possible to send e-mail to multiple adresses?

    • @TKSJa
      @TKSJa  3 года назад +1

      Yes, just use a comma. Example "john@abc.com, mary@gmail.com"

    • @gunchag
      @gunchag 3 года назад

      @@TKSJa Thank you!

  • @SaidulHassan
    @SaidulHassan 6 лет назад +1

    I want to monitor 2 different ISP link; in a failover load balance setup. How do I setup hosts in Netwatch? @TKSJa

    • @TKSJa
      @TKSJa  6 лет назад +1

      Netwatch pings an IP address and is not concerned with the interface that it goes through. So I am not sure how that would work.

    • @SaidulHassan
      @SaidulHassan 6 лет назад

      Thanks +TKSJa I was afraid this was the case. So what tool/method I can use to get alert when one of my ISP is down? I mean the physical link is up but internet is inaccessible?
      Btw, could you please place all your tutorial scripts here tksja.com/downloads/ so we can download, save, import directly.

    • @SyakirIshak
      @SyakirIshak 5 лет назад

      Have you found your solution for this? I'm having the same problem.

  • @utube3939
    @utube3939 5 лет назад

    Hi bro! Plz make video when hotspot user login or logout then microtik send ua email

  • @shuchangKuo
    @shuchangKuo 5 лет назад

    how to check for mack address?

    • @TKSJa
      @TKSJa  5 лет назад

      That's very technical

  • @ekpesinyang7806
    @ekpesinyang7806 6 лет назад

    I've configured it but i'm not getting e-mails why ?

    • @TKSJa
      @TKSJa  6 лет назад +1

      Configure this first: ruclips.net/video/CMPEVBd4dYw/видео.html

    • @leonelchabela9381
      @leonelchabela9381 5 лет назад

      same with me, did you solved it?

  • @Rouly88
    @Rouly88 6 лет назад

    Make watchdog video

    • @TKSJa
      @TKSJa  6 лет назад

      Adding it to my list

    • @Rouly88
      @Rouly88 5 лет назад

      Please how to use this tutorial for monitoring Local networks

  • @canfz7286
    @canfz7286 6 лет назад

    if wan link is down how it ll be send mail ?

  • @abbasmikrotik1635
    @abbasmikrotik1635 Год назад

    Internet connection when the electricity is disconnected

  • @hugohelvio2076
    @hugohelvio2076 3 года назад

    2 wan link how?

    • @TKSJa
      @TKSJa  3 года назад

      ruclips.net/video/GeuuNE3EPBA/видео.html