Community discussions

MikroTik App
 
User avatar
CoUL
newbie
Topic Author
Posts: 45
Joined: Thu Feb 05, 2015 11:34 pm
Location: Ukraine

[Device.Name] as an argument

Sun Aug 23, 2020 11:06 pm

[array_element(oid_column("1.3.6.1.2.1.2.2.1.1"),array_find(oid_column("1.3.6.1.2.1.2.2.1.2"),"sfp-sfpplus1"))]

[array_element(oid_column("1.3.6.1.2.1.2.2.1.1"),array_find(oid_column("1.3.6.1.2.1.2.2.1.2"),"[Device.Name]"))]

How to make it work?

The first option works
The second is the same, but the name of the interface (sfp-sfpplus1) is written in [Device.Name]
You do not have the required permissions to view the files attached to this post.
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: [Device.Name] as an argument

Mon Aug 24, 2020 7:06 pm

I am not exactly sure what you are trying here but Device.Name is a built in function that returns 1.3.6.1.2.1.1.5.0, the system name, would that work?

The function dev_name is exactly
if(string_size(oid("iso.org.dod.internet.mgmt.mib-2.system.sysName.0")),oid("iso.org.dod.internet.mgmt.mib-2.system.sysName.0"),"ghosting")

It looks like you are trying to find device.name in the oid 1.3.6.1.2.1.2.2.1.2 so I can't test since I don't have a system where the interface is the same name as the device name but it might work like this.
[array_find(oid_column("1.3.6.1.2.1.2.2.1.2"),dev_name())]

Let us know.
Joe
 
lebowski
Forum Guru
Forum Guru
Posts: 1619
Joined: Wed Aug 27, 2008 5:17 pm

Re: [Device.Name] as an argument

Mon Aug 24, 2020 8:04 pm

[array_element(oid_column("1.3.6.1.2.1.2.2.1.1"),array_find(oid_column("1.3.6.1.2.1.2.2.1.2"),dev_name()))]

If that doesn't work, it is not possible...As far as I know.
 
User avatar
CoUL
newbie
Topic Author
Posts: 45
Joined: Thu Feb 05, 2015 11:34 pm
Location: Ukraine

Re: [Device.Name] as an argument

Mon Aug 24, 2020 8:09 pm

[array_element(oid_column("1.3.6.1.2.1.2.2.1.1"),array_find(oid_column("1.3.6.1.2.1.2.2.1.2"),dev_name()))]

If that doesn't work, it is not possible...As far as I know.
I thought so, but I wanted the opinion of an expert ... :). It's a pity it would greatly expand the possibilities of The Dude.
Thanks for the help!
 
User avatar
geoffsmith31
Member Candidate
Member Candidate
Posts: 155
Joined: Fri Nov 05, 2010 6:08 am
Location: Toowoomba, Australia

Re: [Device.Name] as an argument

Sat Sep 12, 2020 8:57 am

Have you tried device_property("Name") to return the device name?

I'm running version 4b3 on a Windows server and am using device_property("CustomField1") and device_property("CustomField2") to extract device information for use as parameters for some function probes.

Who is online

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