How to register a global hotkey for your application in C#

How to register a global hotkey for your application in C#

Register a hotkey for your application that can be triggered even if your form is minimized and does not have focus. More »

Visual Studio 2013

Visual Studio 2013

Visual Studio 2013 is now available. Make sure to upgrade to the latest version of Visual Studio. More »

How to download a file in C# (progressbar and download speed)

How to download a file in C# (progressbar and download speed)

Learn how to download files in C# while displaying the percentage and the download speed. More »

UDP hole punching implementation in C#

UDP hole punching implementation in C#

Learn how to implement UDP hole punching so you can make your clients life a lot easier by not forcing them to open ports on their end. More »

 

Automatically check for MikroTik software updates

MikroTik Logo

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.

Share on FacebookTweet about this on TwitterShare on Google+Share on StumbleUponShare on LinkedInShare on RedditPin on PinterestShare on TumblrDigg thisPrint this pageEmail this to someone

One Response to Automatically check for MikroTik software updates

  1. Freek says:

    Thank you very much! Works great

Leave a Reply

Your email address will not be published. Required fields are marked *