Sunday, October 25, 2020

Mikrotik Netwatch Send SMS

Mikrotik script, that we can use to simplify our administering task. At Mikrotik, it is possible to automatic command execution using a script. Such as, send an email or SMS to the administrator for any critical situation, automatically enable or disable route for any unexpected situation and many more.

In this tutorial, we will discuss about the script for sending an SMS that we can use at various situations.

The script for send message:-

tool sms send message="link down" phone-number=your_mobile_number channel=your_channel_number port=Your_port

For example:-

tool sms send message="link down" phone-number=123456 channel=3 port=usb3

Below, the whole process is shown graphically: -


Now click on the add (+) sign to create a new entry.


Now, our host address will be 8.8.8.8 (as per our example). The router will check this link by "1" minute interval. If the router doesn't get any response under 1000 milliseconds, then the link will be considered as down.


Now, we are going to add the "Up" script and "Down" script. If the link goes down, then the down script will be executed and at the same time, when the link will get back then the up script will be executed.
To add the "Down" script, we have to navigate the "Down" tab. And there we will write the script to send SMS to the mobile phone.


Now, to add "Up" script go to "Up" tab.


Finally, then, click on "Apply" and then "Ok". The entry will be look like this:-


From now on, if the link status goes down, then it will execute "Down" script and when the link get back, then it will execute "Up" script.

Done.


No comments:

Post a Comment