Custom Device Labels in “The Dude” nms

Custom Device Labels in “The Dude” nms

The Dude is a powerful network monitoring server from MikroTik. The majority of people I see only use it to monitor their MikroTik routers and wireless devices. In this article I will introduce you to a variety of ways I use The Dude to query SNMP values from many different types of devices.

Out of the box, The Dude will sometimes (if SNMP credentials are correct) display CPU load, memory and disk usage for monitored devices. This data is presented in the device’s label. The following screenshot illustrates how to edit the label.

Another technique you will use to find the values you want to present in the label is by running snmpwalk on a device. Here is how to snmpwalk a device and copy the device uptime oid.

If we want to present this SNMP value in our label use the `oid()` function wrapped in square brackets like this.

Uptime: [oid("1.3.6.1.2.1.25.1.1.0")]

Now that you have the concept down, lets look at some examples of SNMP data from a variety of devices.

MikroTik RB2011 Router – Custom Label

Here I’ve just assembled some of the useful data presented by the MikroTik RB2011 RouterBoard router. It’s a bit overkill but gives you an idea of what’s possible.

[Device.Name]
[oid("1.0.8802.1.1.2.1.3.4.0")]
Identity: [oid("1.3.6.1.2.1.1.5.0")]
RoS Version: [oid("1.3.6.1.4.1.14988.1.1.7.4.0")]
CPU: [oid("1.3.6.1.2.1.47.1.1.1.1.7.65536")] [oid("1.3.6.1.4.1.14988.1.1.3.14.0")]MHz
Voltage: [oid("1.3.6.1.4.1.14988.1.1.3.8.0")/10] V
Temperature: [oid("1.3.6.1.4.1.14988.1.1.3.10.0")/10] C
Serial#: [oid("1.3.6.1.4.1.14988.1.1.7.3.0")]
Clock: [oid("1.3.6.1.2.1.25.1.2.0")]
Uptime: [oid("1.3.6.1.2.1.25.1.1.0")]
[device_performance()][Device.ServicesDown]

Presented on The Dude network map the above label looks like this. I have also uploaded and added an image of the RB2011.

Ubiquiti AirFiber AF-5X – Custom Label

This example shows the chain0 and chain1 receive signal levels and wireless center frequency for an AirFiber PtP Wireless Link.

[Device.Name]
Freq: [oid("1.3.6.1.4.1.41112.1.3.1.1.5.1")/1000] MHz
RSSI: [oid("1.3.6.1.4.1.41112.1.3.2.1.11.1")]/[oid("1.3.6.1.4.1.41112.1.3.2.1.14.1")] dB
[device_performance()][Device.ServicesDown]

Here is what this device physically looks like and what the label looks like on The Dude map.

CyberPower UPS w/ RMCARD205

This example shows how you can use SNMP data to gather battery runtime, temperature, and voltage from a CyberPower Rack Mount UPS. I’ve had to do some odd spacing to get the labels and values to lineup properly.

[Device.Name]

AC Source Voltage:               [oid("1.3.6.1.4.1.3808.1.1.1.3.2.1.0")/10]V 
 Battery Capacity:               [oid("1.3.6.1.4.1.3808.1.1.1.2.2.1.0")]%
   Battery Temp:                 [round((( oid("1.3.6.1.4.1.3808.1.1.1.2.2.3.0") / 10 ) * 1.8 ) + 32)] F
Battery Runtime:     [oid("1.3.6.1.4.1.3808.1.1.1.2.2.4.0")]

[device_performance()][Device.ServicesDown]

Here is a photo of the device and the label as presented on The Dude.

Cordex CXCM Remote Power/Battery Controller

This is a more specialized example from a CXCM Power controller which handles remote cabinet battery charging and power supplies.

[Device.Name]
[device_performance()][Device.ServicesDown]
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.1")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.1")/100]V
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.2")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.2")/100]A
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.3")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.3")/100]V
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.4")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.4")/100]A
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.5")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.5")/100]V
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.6")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.6")/100]C
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.7")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.7")/100]
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.8")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.8")/100]%
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.9")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.9")/100]%
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.10")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.10")/100]A
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.11")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.11")/100]V
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.12")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.12")/100]
[oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.4.13")]: [oid("1.3.6.1.4.1.7309.4.1.6.2.2.1.3.13")/100]
[oid("1.3.6.1.4.1.7309.4.1.6.4.2.1.4.1")]: [oid("1.3.6.1.4.1.7309.4.1.6.4.2.1.3.1")/100]V

======= Begin Alarms =======
[if(oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.3.1") =0, "", oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.4.1"))]
[if(oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.3.2") =0, "", oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.4.2"))]
[if(oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.3.3") =0, "", oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.4.3"))]
[if(oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.3.4") =0, "", oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.4.4"))]
[if(oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.3.5") =0, "", oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.4.5"))]
[if(oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.3.6") =0, "", oid("1.3.6.1.4.1.7309.4.1.5.5.2.1.4.6"))]

The Device on “The Dude” w/ above Custom Label

AVTech Environmental Monitor – Custom Label

[Device.Name]
[device_performance()][Device.ServicesDown]

[oid("iso.org.dod.internet.private.enterprises.20916.1.7.1.1.2.0")] Temp: [tempager_sensor1_temp()] F
[oid("iso.org.dod.internet.private.enterprises.20916.1.7.1.2.1.3.0")] Temp: [tempager_sensor2_temp()] F
[oid("iso.org.dod.internet.private.enterprises.20916.1.7.1.2.2.3.0")]: [tempager_sensor3_temp()] F
# tempager_sensor1_temp() function
round(oid("1.3.6.1.4.1.20916.1.7.1.1.1.2.0")/100)

Abstracting Labels up into functions

With this next example I have packaged up the `oid()` calls into several reusable functions. If you have many devices that share the same label this is a better approach. If you want to make changes to what’s presented in the label you only have to edit the called function instead of each device’s label.

CyberPower ATS PDU (Auto Transfer)- Custom Label

[Device.Name]
[device_performance()][Device.ServicesDown]

[oid("iso.org.dod.internet.private.enterprises.20916.1.7.1.1.2.0")] Temp: [tempager_sensor1_temp()] F
[oid("iso.org.dod.internet.private.enterprises.20916.1.7.1.2.1.3.0")] Temp: [tempager_sensor2_temp()] F
[oid("iso.org.dod.internet.private.enterprises.20916.1.7.1.2.2.3.0")]: [tempager_sensor3_temp()] F

The label_cyberpower_atspdu() Function

concatenate("SrcA: ", cyberpower_ats_srca_voltage(), "v | SrcB: ", cyberpower_ats_srcb_voltage(), "v")

The cyberpower_ats_srca_voltage() Function

round( 
    oid("1.3.6.1.4.1.3808.1.1.5.2.2.2.1.5.1") / 10
)

The cyberpower_ats_srcb_voltage() Function

round( 
    oid("1.3.6.1.4.1.3808.1.1.5.2.2.2.1.5.2") / 10
)

As you can see the syntax is different, all output data must be concatenated together.  The ATS devices can be seen on the map along with the AVTech Room Monitoring in the screenshot above.

Dell PowerEdge Servers

[Example coming soon] but you can access (via SNMP) a wealth of data about Dell PowerEdge Servers if you install and configure the Windows Server SNMP feature along with the Dell OpenManage Tools.  SNMP data such as temperature, RAID controller, disk, power supply, chassis fan statuses are available.

I hope you found this article about configure The Dude from MikroTik useful, feel free to leave a comment below.

NetScout LinkRunner G2

LinkRunner G2 is the ultimate network cable test tool


CAT5 Cable Tester, Measure Cable Length,
PoE Voltage, Network Connectivity, Switch Port ID
Optional Wireless & Fiber Optics Modules
Check Price on Amazon

One Reply to “Custom Device Labels in “The Dude” nms”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.