Monitoring MikroTik RouterOS is easy with PRTG
Originally published on November 23, 2020 by Jasmin Kahriman
Last updated on September 07, 2021 • 15 minute read
MikroTik provides routing, switching and wireless equipment for all possible uses – from the customer location up to high-end data centers. Back in 1997, MikroTik developed a RouterOS software system that provides extensive stability, controls, and flexibility for all kinds of data interfaces and routing. Five years later, MikroTik created their own hardware called RouterBoard which today in combination with RouterOS supports all the necessary features for an ISP - routing, firewall, bandwidth management, wireless access point, backhaul link, hotspot gateway, VPN server, and more. Their products are not only used by ISPs, but also by individual users and companies for building data network infrastructures all around the world.
In this article, you´ll see how PRTG monitors the hardware and software components of MikroTik devices. For demonstration purposea, I'll use a multi-port MikroTik RB3011 router running on an ARM architecture CPU (1.4 GHz x 2), 1 GB RAM, and 128 MB disk space. The RB3011 has ten Gigabit ports divided into two switch groups, an SFP cage and a SuperSpeed full-sized USB 3.0 port, for adding storage or an external 3G/4G modem. The RB3011UiAS-RM unit comes with a 1U rackmount enclosure, a touchscreen LCD panel, a serial console port, and PoE output functionality on the last Ethernet port.
Using General and SNMP sensors
PRTG has dozens of sensors you can use to monitor metrics on your MikroTik or any other device. By using General sensors and some of the SNMP sensors, we can get insight into diverse metrics such as availability, port status, uptime, utilization and logging.
The starting point would be to add Ping sensor, HTTP sensor and Port sensor. They will check if the MikroTik device can respond to ICMP or HTTP queries, and if certain ports are open and accessible. For example, port 8291 is used for connecting via Winbox and 8728 for API connections.
As both PRTG and MikroTik can speak SNMP (v1, 2c and v3), we can leverage off it by adding the following SNMP sensors: SNMP System Uptime sensor, SNMP CPU Load sensor, SNMP Memory sensor and SNMP Disk Free sensor. As the names of the sensors imply, these sensors will provide us with the metrics of system uptime, CPU load, physical memory and free disk space.
Any configuration change done within the RouterOS and that can be detected by SNMP Trap or logging can also be shown in PRTG by using two receiver sensors – SNMP Trap Receiver sensor and Syslog Receiver sensor.
By navigating to “MikroTik UI > IP > SNMP”, you can enable and configure SNMP and SNMP Traps. The Syslog protocol can be enabled and configured at “MikroTik UI > System > Logging > Actions > remote”.
And this is only a part of the metrics we can gather with PRTG. Curious to know how to monitor network traffic via SNMP and xFlow? If so, please continue reading.
Monitoring network traffic
As a responsible administrator, you hope to obtain an overview of how much traffic is flowing through your network. PRTG lets you optimize network capacity planning by using our native SNMP Traffic sensor which shows incoming, outgoing and total network traffic per interface. As the channels within this sensor are customizable, you can also include metrics for errors, discards, unicast, non-unicast, multicast and broadcast.
The graph for SNMP Traffic is shown below:
By using the SNMP Custom Table sensor and MikroTik MIB file (e.g. OID: 22.214.171.124.4.1.149126.96.36.199.1.1), we can get more information about network traffic per network interface. Wait…SNMP Custom Table, MikroTik MIB, OID? Don’t worry, this is a part covered in the last section of this article.
Would you like to get more information than the amount of the incoming, outgoing or total traffic? By using our flow sensors, PRTG can provide the details about bandwidth consumption per connection, protocol or talker. One of the most powerful RouterOS feature is sending flows via IPFIX and/or NetFlow v5 and/or NetFlow v9 to multiple destination flow collectors. We have got you covered here with our native flow sensors: IPFIX sensor, NetFlow v5 sensor or NetFlow v9 sensor. On the screenshot below, you can see a part of the toplist “Top Connections” which shows 5-tuple (source IP, source, port, destination IP, destination port, protocol).
Using SNMP Custom sensors
PRTG also offers custom SNMP sensors. The monitoring capabilities of these sensors extend the scope of the general sensors. With custom sensors, you can show certain values that are not included in the standard libraries of PRTG. With these sensors, you can monitor most devices that support SNMP and for which PRTG does not have native sensors.
You´ll need to download MIB (Management Information Database) from the MikroTik website and then import it into the PRTG by using Paessler MIB Importer. MIB files are hardware and operating system-independent information files that tell network management systems how to retrieve in-depth data using the SNMP protocol from network devices. You can download the latest MikroTik RouterOS MIB file (Last updated: 15-Sep-2020). MIBs used in RouterOS v6.x:
By using SNMP Custom String sensor and OID 188.8.131.52.4.1.149184.108.40.206.7.0, you will get notified by PRTG in case there is a new RouterOS available for your MikroTik.
If you go back to the part about bandwidth monitoring, you will notice that Network Interface Statistics are being measured by the SNMP Custom Table sensor and OID: 220.127.116.11.4.1.14918.104.22.168.1.1.
But what if you would like to import the entire MIB file and choose what you want to monitor? That is also possible, you can easily do it by using SNMP Library sensor, choosing the imported MikroTik MIB and OIDs of your preference. As a result, you might see similar sensors as shown in the screenshot below.
Monitoring via API
MikroTik RouterOS also supports API which give us the opportunity to gather different information by using HTTP XML/REST Value sensor and REST API sensor. API closely follows syntax from CLI. To use API RouterOS, version 3.x or later is required and API service (port 8728) enabled. API Documentation is available at this LINK.
I really enjoy working with MikroTik devices and I'm curious to learn more about how you are monitoring your MikroTik devices in your IT infrastructure!