Display live values on Dude

Hi,

We’re trying to extract and display tx-ccq from registration-table into Dude.
Tx-ccq is not in snmp, however it’s easily extracted using e.g.

/interface wireless registration-table get [find interface="wlan1"] tx-ccq

The question is how can we run this from Dude(function, probe etc) and have the live value displayed on our devices in the network map?

You could create a Dude Function with the code below, where “Client1” is the name of the client’s radio-name you are trying to display. I’ve found you can’t use the value “Interface” on an AP as it does not return one unique answer string. I.e. you may well have more than one client connected to an interface on an AP and using the code below with a matcher to interface=“wlan1” will return multiple values and raise an error. There may well be a way to further parse the table if there are multiple entries but I haven’t tried to do that. You can use any other unique value if the clients are not MT devices, such as their MAC Address. If you are doing this on a client, then there will be only one entry in the table and using interface=“wlan1” will work fine as long as that is the name of your interface of course.

ros_command(":put [/interface wireless registration-table get [find where radio-name=\"Client1\"] tx-ccq]")

You could then add the function to the appearance of a device with the following string (where ‘Client1_txccq’ is the actual name of the function):

[Client1_txccq()]

edit:
Thanks, it worked.
We originally used the radio-name of the base instead of the client. -.-

Cheers!

I wanted to monitor the CCQ level with the function described above- but unfortunately, it does not work for me.
What I am doing wrong?

Right now i’m checking the CCQ value using OID (Tx Overall CCQ).
But when i got p2p links connected using NV2 protocol OID value is empty.

First, check at Dude’s RouterOS Table whether Dude is able to read data from the Mikrotik’s RouterOS. For example, at Registration Table you should see information concerning wireless interface. Mind that the monitored MikroTik operates in the Client Mode:
RadioName.png
If no value(-s) are displayed, verify if details to log to Mikrotik are entered correctly at General Table
General.png
Wait several minutes and if you still can not see any information at RouterOS Tab, it might be an issue of a combination “MikroTik Device x RouterOS version”, or a bug in the Dude.

If you succeed, write down the value from the “Radio Name” column. It’s usually an SSID (or BSSID) of the Access Point. In case its name is too long, it may be displayed in abbreviated form. Thus, write down the text exactly as displayed in the Dude.

Create the custom function with the following script:

ros_command(":put [/interface wireless registration-table get [find where radio-name=VerafREE5n-AP1] tx-ccq]")

where “VerafREE5n-AP1” is the value from the “Radio Name” column. Of course, you can replace “tx-ccq” with another flag to monitor other wlan stats, i.e. rx-ccq, tx-signal-strength etc.

To display wlan stats together, you can try something like this, where tx_signal_strength(), tx_ccq() and rx_ccq() are your custom functions:

[Device.Name]
[device_performance()][Device.ServicesDown][snmp_uptime()]   
TX [dBm]:     [tx_signal_strength()]RX [dBm]:     [oid("iso.org.dod.internet.private.enterprises.mikrotik.mikrotikExperimentalModule.mtXRouterOs.mtxrWireless.mtxrWlRtabTable.mtxrWlRtabEntry.mtxrWlRtabStrength")]
TxCCQ [%]:   [tx_ccq()]RxCCQ [%]:   [rx_ccq()]

The result should look like this:
MikroTik.png
Sometimes, after restarting the Dude Server and/or the Client, the values which were loaded via the aforementioned scripts might not be displayed further. Deleting all commands from Appearance/General/Label, saving, reinserting the commands, and saving again usually helps. Similar procedure works also if you are using Dude graphs to display these statistics. However, Dude may stop reading data from RouterOS “spontaneously” from time to time (RouterOS Tab is then “empty”). Then, of course, above mentioned data are not displayed as well.

Another way to view wlan statistics is using Telnet. For example, to display TxCCQ, use:

:put [/interface wireless registration-table get [find where radio-name=VerafREE5n-AP1] tx-ccq]

It should work even in cases, where above method fail. If I am not mistaken, Telnet is used to display statistics from MikroTik in Munin monitoring.