Community discussions

MikroTik App
 
cgreen
newbie
Topic Author
Posts: 34
Joined: Wed Aug 15, 2012 7:54 am

custom label for the dude

Tue May 20, 2014 6:02 pm

I am trying to use a custom label for the wireless devices to show the number of wireless clients connected to the AP.
The problem I am having is that we use VirtualAP’s to broadcast 2 SSID’s that students can connect to for different purposes.
The label I’m using is…
[Device.Name]
[device_performance()][Device.ServicesDown][wireless_clients()] Wireless Clients
I created a function for wireless_clients and here is the code for it…
array_size(oid_column("iso.org.dod.internet.private.enterprises.mikrotik.mikrotikExperimentalModule.
mtXRouterOs.mtxrWireless.mtxrWlRtabTable.mtxrWlRtabEntry.mtxrWlRtabStrength"))
there is also a probe that references the function above.
It is…
Name=wireless_probe
Type=function
Agent=default
Available= wireless_clients()
Error=if(wireless_clients(). “”.””)
Value=wireless_clients()
Unit:clients
I took a screenshot of the dude map. I would like for it to display…
DEVICE NAME
CPU USAGE, POE Voltage, Disk usage
VirtualAP1 # of clients connected
VirtualAP2 # of clients connected

how would I make this work for our config.
Is there any way for this to work and show the number of wireless clients connected to each virtual ap?
If it matters all of the devices on campus are Mikrotik metal 2.4ap’s and an OmniTik with SXT’s for the PTMP links.
Let me know if you need any additional info.
Thank you for your help.
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: custom label for the dude

Tue May 20, 2014 6:30 pm

I use this method, you can use as hint or a guide to your needs:

on cpu_mem_disk add before the last ")":
,
if(conta_client() > 0, concatenate(" LINK ", conta_client()), "")
and add one new function called "conta_client":
if(device_property("Ros"),string_substring(ros_command("/interface wireless registration-table print count-only"),0,string_size(ros_command("/interface wireless registration-table print count-only"))-2),0)
you can modify the function to check only one wlan module, or display separathed values for each wlan ;)
 
cgreen
newbie
Topic Author
Posts: 34
Joined: Wed Aug 15, 2012 7:54 am

Re: custom label for the dude

Tue May 20, 2014 6:58 pm

ok... let me give that a try.
i dont care if it shows client connected count for each VirtualAP or it it shows a combined count of registered users.
either way is good with me.
 
cgreen
newbie
Topic Author
Posts: 34
Joined: Wed Aug 15, 2012 7:54 am

Re: custom label for the dude

Wed May 21, 2014 12:00 am

ok how do you configure a virtual ap inside of router os or how do i make this work with virtual ap's .

this would be perfect if i had multiple physical wlan cards but in the metal devices i only have one, hence the reason for the virtual ap's.

i dont know how to add virtualap's in the terminal. i just use winbox to add them. i am unable to find anywhere where it talks about configuring virtual ap's in the terminal.

any ideas?????
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: custom label for the dude

Wed May 21, 2014 12:04 am

Virtual AP for do what?
 
cgreen
newbie
Topic Author
Posts: 34
Joined: Wed Aug 15, 2012 7:54 am

Re: custom label for the dude

Wed May 21, 2014 12:10 am

for student access across campus i use the Mikrotik Metal 2.4GHz AP's.
this device has 1 WLAN interface and 1 EHT interface.
i create 2 VirtualAP's and use WLAN1 as the master interface.
this allows me to create 2 different SSID's to broadcast, using different VLAN tags and security profiles.

this is where the problem is i cant adapt this code to work because i dont know what the virtual ap's are labeled as inside of the command line interface.
snip.PNG

im trying to display how many users are connected to either the entire device or each virtual ap. either was is ok.
You do not have the required permissions to view the files attached to this post.
 
cgreen
newbie
Topic Author
Posts: 34
Joined: Wed Aug 15, 2012 7:54 am

Re: custom label for the dude

Wed May 21, 2014 6:14 pm

ok i got this far...
i used the OID from
/interface wireless print oid
and applied it to the label as
[Device.Name] [Device.FirstAddress]
[device_performance()][Device.ServicesDown]
Wireless Clients: [oid("1.3.6.1.4.1.14988.1.1.1.3.1.6.5")]
Wireless Clients: [oid("1.3.6.1.4.1.14988.1.1.1.3.1.6.6")]
Wireless Clients: [oid("1.3.6.1.4.1.14988.1.1.1.3.1.6.12")]
but it still dont work.
it looks like this now....
snip2.PNG
does anyone know why?
is it because it is a VirtualAP instead of a physical WLAN interface?
You do not have the required permissions to view the files attached to this post.
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: custom label for the dude

Wed May 21, 2014 9:29 pm

Image

You can see LINK 7 provided from my code, you must personalize the script inside the code for obtain ANOTHER function called on another name :)
 
cgreen
newbie
Topic Author
Posts: 34
Joined: Wed Aug 15, 2012 7:54 am

Re: custom label for the dude

Wed May 21, 2014 9:40 pm

you lost me ....
i have no idea what you mean
 
User avatar
rextended
Forum Guru
Forum Guru
Posts: 11982
Joined: Tue Feb 25, 2014 12:49 pm
Location: Italy
Contact:

Re: custom label for the dude

Wed May 21, 2014 10:16 pm

When I'm at the office I try to help you.

If I miss this, write on this topic, if you already not have solved later.
 
cgreen
newbie
Topic Author
Posts: 34
Joined: Wed Aug 15, 2012 7:54 am

Re: custom label for the dude

Wed May 21, 2014 10:22 pm

ok thank you very much. im at a stand still until i hear back from you.
 
Atanas
just joined
Posts: 19
Joined: Fri Jan 25, 2019 8:53 am

Re: custom label for the dude

Thu Dec 19, 2019 4:42 pm

Hello,
Can someone help me to make this customized device label: If a device has "Name" then label should display Name and IP address else display only IP address.
Default device label in Dude v6.45.3 displays [Device.Name]. However, many devices do not return "Name", but IP address instead. In this case, if both [Device.Name] and [Device.FirstAddress] are used, IP address appears twice.

I wrote the following function named DeviceName():
if("[Device.Name]" <> "[Device.FirstAddress]", "[Device.Name]", "")
but it always returns nothing, because [Device.Name] = [Device.FirstAddress], which can be checked with this function:
if("[Device.Name]" = "[Device.FirstAddress]", "true", "false")

In addition, I would like the following label to show only one row when these variables return equal values, not two - where the first one is empty:
[DeviceName()]
[Device.FirstAddress]

If reversed, it shows only one row, but this is not the case I would prefer, because I want the iP address to be placed at the bottom:
[Device.FirstAddress]
[DeviceName()]

Why do you guys from Mikrotik put IP address in the Device.Name variable at all? If there is no Name, or it matches Device.FirstAddress, do not display it.
Same for device_property("Name") function, it may be just returns the value of Device.Name variable.

There is an option in Device Discovery settings named "Device Name Preference" with some sets of naming sequences but even they a useless in my case, because IP address persists in all options and if the device name cannot be resolved via DNS, SNMP or NETBIOS the IP address is returned as device name. Provided there is a separate variable for IP address Device.FirstAddress, I really do not understand why did you put IP address in device naming options at all?!

Who is online

Users browsing this forum: No registered users and 16 guests