Tag Archives: RouterBoard

Automatically check for MikroTik software updates

If you own multiple MikroTik devices (or even one) you already know how annoying and time consuming it is to keep checking if there are new updates available for your devices all the time.

The purpose of this tutorial is to help you setup your devices in order to receive an email notification if a new software update is available to download for your device.

Step 1

First of all, we need to setup the SMTP settings of your MikroTik device to allow it to send emails when required.

Using WinBox, or the web interface, navigate to Tools --> Email and change your settings as shown in the image below. Please note that the image contains sample data and requires from you to change the settings with a working SMTP as well the correct credentials, if required.

mikrotik smtp settings

If you prefer to use the CLI over the web interface or WinBox, you can use the command below:

Make sure to send a test email to verify that everything is working properly.

Step 2

Now that our MikroTik device is able to send emails it is time to create our script which will be responsible for checking for new updates and sending us an email if one is available.

Navigate to System --> Scripts, click Add, change the title to “Check for software updates” or to something else if you prefer (don’t forget the name, you will need it in step 3) and finally, paste the following script in the source area:

CLI Version (pay attention to the highlighted line)

Step 3

It is time for the last step. In order for everything to work properly, we need to trigger our script every now and then in order for the update check to take place. To accomplish this, we will use the scheduler feature which is located under System --> Scheduler

Simply add a new scheduled task, give it a name and specify how often it should run in the interval section (I run mine with a 2d 00:00:00 interval).

In the “On Event” section paste the line below.

Important: Make sure the name of the script is exactly the same as the one you have created in step 2!

CLI Version

And you are done! If you have successfully followed this example your MikroTik device will check every 2 days for new updates and will let you know by email if one is available.

This method has been tested in the last few versions of RouterOS (currently 6.38). For older versions you might need to alter the script functions a bit to get everything working correctly.

If you have any questions don’t hesitate to ask them in the comment section below.