Community discussions

MikroTik App
 
frogale
just joined
Topic Author
Posts: 21
Joined: Thu Jun 22, 2006 11:57 pm

Concatenate OID with Interface.Index

Sun May 16, 2010 10:26 pm

Hi to all Dude masters.. I am trying to print frequency of specific link (Appereance Label menu) with concatenating OID and [Interface.Index] value:

[oid(concatenate("1.3.6.1.4.1.14988.1.1.1.1.1.7.","[Interface.Index]"))]

I've tried many combinations from manual at http://wiki.mikrotik.com/wiki/Manual:Scripting and other forum posts but I am getting only text output like this:

[oid(concatenate("1.3.6.1.4.1.14988.1.1.1.1.1.7.","4"))]
([Interface.Index] is replaced with right iface number and nothing else)

What is wrong? :?
 
User avatar
gsandul
Member Candidate
Member Candidate
Posts: 154
Joined: Mon Oct 19, 2009 1:42 pm

Re: Concatenate OID with Interface.Index

Mon May 17, 2010 8:24 am

What is wrong? :?
The Dude does not know IP addres of device you are trying to get oid, because you are working with link(in a link context), not with device.

You must provide device IP to function "oid"

Your function should look like
oid(concatenate("1.3.6.1.4.1.14988.1.1.1.1.1.7.","[Interface.Index]"),"5","300","DEV.IP.ADD.RES","Community_Group")

for more info you look at oid function description.
 
frogale
just joined
Topic Author
Posts: 21
Joined: Thu Jun 22, 2006 11:57 pm

Re: Concatenate OID with Interface.Index

Mon May 17, 2010 10:30 am

This command:
[oid(concatenate("1.3.6.1.4.1.14988.1.1.1.1.1.7.","4"))]
works fine..

And [Interface.Index] alone returns correct value (4)..

I have problem with using OID and variable together..

Btw
[oid(concatenate("1.3.6.1.4.1.14988.1.1.1.1.1.7.","[Interface.Index]"),"5","300","10.38.0.43","public")]
doesn't work either (same textual output)..
 
User avatar
blackpaw
newbie
Posts: 37
Joined: Thu Jan 28, 2010 7:19 pm
Location: Amsterdam, NL

Re: Concatenate OID with Interface.Index

Thu Jul 01, 2010 1:52 pm

I was breaking my head over this one, too...

Anyone can confirm this is not possible? According to me there are too many [[[]]] in the function...confusing functions/variables

Edit: Dude 4 beta has a new function "link_index" which works!
I did: [oid(concatenate("1.3.6.1.4.1.9.2.2.1.1.28.",link_index()))] and it returned my interface description.

try that?



Andreas
life is one of the hardest
 
User avatar
gsandul
Member Candidate
Member Candidate
Posts: 154
Joined: Mon Oct 19, 2009 1:42 pm

Re: Concatenate OID with Interface.Index

Thu Jul 01, 2010 5:45 pm

TNX, blackpaw
Now we can easy determine the direction of traffic flow.
links.JPG
The code for link apeareance is
Gi 1/0/21 -- Gi 1/0/2
Rx: [Interface.InBitRate]
Tx: [Interface.OutBitRate]
RxPPS:[Interface.InUnicastPacketsRate]
TxPPS:[Interface.OutUnicastPacketsRate]
Stats on: [oid(concatenate("1.3.6.1.2.1.2.2.1.2.",link_index()))]
I can see the link monitored and I know traffic direction(rx and tx may differ). In the sample traffic is measured from switch Gi1/0/23, not from main router Gi1/0/2.
You do not have the required permissions to view the files attached to this post.

Who is online

Users browsing this forum: No registered users and 13 guests