Over the past years I replaced all my networking gear with Mikrotik devices. I absolutely love WinBox for management, but sometimes I miss some fancy charts and graphs. Luckily, RouterOS comes with a REST-API that can be used to query arbitrary data from the device. After some research I found some useful tools and blog posts that solved similar problems. Namely:
- [A blog post by Devin Smith that first got me interested](https://blog.devinsmith.co.za/home-internet-grafana-lockdown/)
You need Ubuntu Server for ARM 64 bit in order to use this setup. You may also use Raspian, but then you are limited to 32bit ARM executables. This would mean, that you need to compile the `mikrotik-exporter` by hand, because there are no pre built 32-bit Docker images.
It might happen that the Grafana dashboard loads, but the graphs remain empty. If the dashboard loads, but no data is shown, this may be caused by the following on of the following reasons:
- invalid credentials for the monitored RouterOS device
- verify with: `/user/print detail`
- invalid host and port for the monitored RouterOS device
- check that the IP or host name of the monitored device is correct
- API service disabled on the RouterOS device
- verify with `/ip/service/print detail`
### What distinguishes this project from other similar projects?
This project is only a personal hobby.
It do it mainly to learn something and to improve my skills.
Therefore, the project does not compete with other projects.
Nor do I aim for completeness or perfection with the project.
The goal of this project is to develop a monitoring solution for multiple RouterOS devices simultaneously that is resource-efficient and scalable.
### Why you don't use the SNMP for monitoring?
Firstly SNMP based monitoring is painfully slow.
In my experience SNMP walks are slow and CPU heavy.
And I am not [alone with this](https://forum.mikrotik.com/viewtopic.php?t=132304).
In my experience the API is much faster and produces less stress on the CPU of the monitored device.
Secondly I never really got used to the way that SNMP metrics and queries are structured.
I find them very hard to read.
In addition, the API offers a lot of flexibility.
Any command can be executed on RouterOS via the API.