Community discussions

MikroTik App
 
turnip
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 86
Joined: Wed Sep 11, 2013 7:01 pm

Syntax for labels

Wed Jan 11, 2017 7:02 am

Is there any documentation, or can anyone give me an example showing the syntax for device labels?
I want to do something like this:

[ros_command(":put [/system identity get name]")] OR [Device_Name]
(ie, if it's an ROS device, get it's identity, otherwise use it's name in The Dude).

Thanks
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: Syntax for labels

Thu Jan 19, 2017 5:58 pm

This works on the appearance of a device label...
[if("1","true","false")]
You should be able to do this
[if(ros_command(":put [/system identity get name]"), ros_command(":put [/system identity get name]), Device_Name)]
I don't have time to get the syntax correct but it should work...

Lebowski
 
tnt2
just joined
Posts: 19
Joined: Wed Jun 23, 2010 2:47 pm

Re: Syntax for labels

Mon Feb 06, 2017 10:19 pm

[if(string_size(oid("iso.0.8802.1.1.2.1.3.4.0"))>1, ros_command(":put [/system identity get name]"), "[Device.Name]")]
 
turnip
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 86
Joined: Wed Sep 11, 2013 7:01 pm

Re: Syntax for labels

Tue Feb 21, 2017 8:08 am

Sorry, only just noticed your answers (didn't see the notification).
That string works nicely. Thanks for your help.

Who is online

Users browsing this forum: GoogleOther [Bot] and 18 guests