Log Signal Strength & GPS Coordinates

I would like to just have a simple script logging WiFi signal strength & GPS coordinates.

I’m not sure where to start…I tried doing it with SNMP which works well for the GPS coordinates, but the signal strength is difficult because the OID keeps changing.

I’d like to be able to just log at a set interval, say every 5 seconds.

If you can see the value in command line on the router, you can make a script that runs every 5 seconds and sends data to a syslog server.

If you have many devices to monitor, syslog may be better in some case compare to SNMP
With SNMP, you need to tell SNMP server each IP/DNS to monitor.
For Syslog, its the device talking home that needs the Syslog server IP, that will be the same for all devices (same config)

Are you trying to do this from a PC/Mac?
Or are running script on the Mikrotik itself?
…Either can work, but what/where/format you want to the resulting GPS+WiFi data determine the script you need.

When you say “OID keeps changing” what specifically are you trying to read on the Wi-Fi?
…OIDs don’t change, just not all may not be useful :wink:.

Thanks for the replies.


If you can see the value in command line on the router, you can make a script that runs every 5 seconds and sends data to a syslog server.

The values I want to read are:
interface wireless>registration-table>signal-strength
system>gps>longitude
system>gps>lattitude

I can easily get the OID for these…not sure how I can view the value in the command line though.


Are you trying to do this from a PC/Mac?
Or are running script on the Mikrotik itself?

I’d like to be able to run the script on the Mikrotik itself.


When you say “OID keeps changing” what specifically are you trying to read on the Wi-Fi?

Just trying the read the signal-strength from the registration table. I think the OID changes dependendant on what AP my Mikrotik is connected to.

Thanks heaps for the assistance!

Here is part of my Syslog script that sends wireless registration table to a Syslog server found here: http://forum.mikrotik.com/t/tool-using-splunk-to-analyse-mikrotik-logs-4-0-graphing-everything/153043/1

{
/interface wireless registration-table
:foreach i in=[find] do={
	:log info message=".id=$i;ap=$([get $i ap]);interface=$([get $i interface]);mac-address=$([get $i mac-address]);signal-strength=$([get $i signal-strength]);tx-rate=$([get $i tx-rate]);uptime=$([get $i uptime]);script=wifi"
}
}

To test it out, copy past this to terminal

{
/interface wireless registration-table
:foreach i in=[find] do={
	:put ".id=$i;ap=$([get $i ap]);interface=$([get $i interface]);mac-address=$([get $i mac-address]);signal-strength=$([get $i signal-strength]);tx-rate=$([get $i tx-rate]);uptime=$([get $i uptime]);script=wifi"
}
}

I do not have gps, but should be simple to get data.

The suggested command works.

As for GPS, it’s located in /system gps
I can run the monitor command and this shows me all the information. I can also print the OID’s for longitude & lattitude…just not sure how I call these through the command line and therefore incorporate them into the script.