In this article, I will show you how to configure automatic sending of email alerts with mikrotik router.
Configure email sending from mikrotik router
Go to "Tools" > "Email"
Because we use Gmail email to send in the following settings, Fill in your Gmail email and password, Do try to send an email click "Send Email".
Next, Go to your Google account. On the left navigation panel click "Security". In a less secure app access panel, Click "turn on access".
Check email inbox sent by mikrotik email. If the incoming email means the configuration is correct. So you have configured sending email from router mikrotik.
Go to "Tools" > "Netwatch".
Netwatch monitor state of hosts on the network. It does so by sending icmp pings to the list of specified IP addresses. We will use netwatch to send email every time the server changes state.
Host: Enter the IP address of the desired destination in this field.
Next configure email sending in case the server is up or down. You can copy the code here:
:log error "Server is up again"
/tool e-mail send to="[email protected]" subject="Server is up on $[/system clock get time]"
:log error "Server is down"
/tool e-mail send to="[email protected]" subject="Server is down $[/system clock get time]"
After the configuration is complete, we will see the results. Every time the server changes from up to down state or vice versa, it sends a notification to your email. In addition, there is also information about the time.