Monitoring and reporting 3G radio signal-strength (RSSI, dBm) on Mikrotik Routerboards

Monitoring a large number of Mikrotik Routerboards is easy using software and tools like LibreNMS and Oxidized, but it is unfortunately not possible to retrieve values for 3G/4G/etc signal-strength RSSI (in dBm) via SNMP when using interfaces like the Sierra MC8705 Mini-PCIe card.

However, using some RouterOS scripts, we can read and push the value for signal strength to a remote listening server using HTTP GET requests. In my case, the server is running Mango Automation software, which also handles the historising, trending and event-detection handling.

3g-signal

Because of some limitations in the way that both globally declared functions and the /interface ppp-client get info command work inside RouterOS, we need to wrap one script inside another, using the wrapper script to both start and then kill the background get-info command (if we don’t kill it, we can’t invoke it again without rebooting). So in total, there are three parts to this method:

  1. A script to run the ppp ‘get-info’ command, opening a serial session to the card, parsing out the value and loading it into a RouterOS global variable.
  2. Another script to form this value into a HTTP GET request, pushing it to the remote server
  3. A scheduler that runs the wrapper script periodically.

Note that in the example below, the SITE variable is used as a globally unique identifier for the transmitting station. This comes into play when we configure the listening data source – we need a way to determine which station is sending the RSSI value.

Get-signal script:

Note: the mis-spelling of “signal-strengh” is not a typo, at least not by me! This is actually the way that the value is spelt in RouterOS! Expect that it may be changed in later versions.

Push-signal script:

To run the script/s, we just add a scheduler job:

Mango Automation Listener Configuration

Add a ‘HTTP data source’ listener with default settings. If you’re running Mango on a port other than 80, you’d need to adjust the :global URL variable in the mikrotik script accordingly.

The Mango datapoint JSON configuration is as follows:

One consideration when doing this: if your 3G signal drops too low, you won’t be able to push the value to the remote server, and the measurement will be lost!  A quick and dirty way to log these in the routerboard itself could be to add these lines (untested) to the push-signal script:

Here’s what a trend for a single radio looks like after three months or so:

3g-signal-single

 

If this post helped you, please leave a comment!

Previous Post

Raspberry Pi internet streaming radio station

My partner has been overseas for a few months and was desperately missing a local radio station. It doesn't have an online stream that she can listen to and so she asked me ... Read more

Next Post

Read the RFCs

I recently moved a bunch of websites over to a VPS (likely the one you are reading this from). It runs Ubuntu with a LEMP stack. I ran into some problems when ... Read more

Leave a Comment