Community discussions

MikroTik App
 
firebat
Member
Member
Topic Author
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Invalid OID. What's wrong with this function?

Fri May 11, 2007 10:03 am

I'm trying to figure out what is wrong with the following function. When I use string_size to get the string size of the OID, it works properly:

string_size((oid(concatenate("iso.org.dod.internet.private.enterprises.trango.tbw.m5830sap.su.suInfoTable.suInfoEntry.suAssociation.",device_property("CustomField3")),30,300,device_property("CustomField2"))))

However, when I just want to retrieve the OID itself, Dude reports it as an invalid OID. All I did was remove string_size from the function. What is wrong?

((oid(concatenate("iso.org.dod.internet.private.enterprises.trango.tbw.m5830sap.su.suInfoTable.suInfoEntry.suAssociation.",device_property("CustomField3")),30,300,device_property("CustomField2"))))


The Device Custom Fields are:
CustomField2 = 10.0.0.20
CustomField3 = 5
 
uldis
MikroTik Support
MikroTik Support
Posts: 3439
Joined: Mon May 31, 2004 2:55 pm

Fri May 11, 2007 1:06 pm

string_size() correctly returns size of string "invalid oid" :)

You should double check that you have Trango mibs loaded in the Dude. Dude
does not recognize result of concatenation as valid oid. Check what output
you get when you put just:

concatenate("iso.org.dod.internet.private.enterprises.trango.tbw.m5830sap.su.suInfoTable.suInfoEntry.suAssociation.",device_property("CustomField3"))
 
winkelman
Member Candidate
Member Candidate
Posts: 235
Joined: Wed Aug 16, 2006 5:00 pm
Location: Amsterdam, The Netherlands

Fri May 11, 2007 1:07 pm

Are you sure the string-size functions does not simply report the number of characters in the returned error-message of the (assumed here) incorrect formula?

[edit] Damn, I could have looked so smart if I'd just have pressed 'Submit' a little faster! :wink: [/edit]
 
rbmota
just joined
Posts: 8
Joined: Thu Apr 19, 2007 5:51 pm

the dot

Sat May 12, 2007 1:15 am

I think you have an extra dot '.' at the end. Or missing something, like a 0.

BR

Ricardo Mota
 
firebat
Member
Member
Topic Author
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Sat May 12, 2007 5:48 am

string_size() correctly returns size of string "invalid oid" :)

You should double check that you have Trango mibs loaded in the Dude. Dude
does not recognize result of concatenation as valid oid. Check what output
you get when you put just:

concatenate("iso.org.dod.internet.private.enterprises.trango.tbw.m5830sap.su.suInfoTable.suInfoEntry.suAssociation.",device_property("CustomField3"))
Uldis:

String size is working correctly. The OID for su association either contains:

associated (1)
or
notAssociated (0)

Associated is 14 characters and notAssociated is 17 characters. When I use the string_size function noted above, I get 14 or 17 returned depending upon if the subsriber unit is associated or not. So Dude seems to accept a concatenated OID if you pass the result to string_size. I actually have a probe setup using this function. :D

For your test:
concatenate("iso.org.dod.internet.private.enterprises.trango.tbw.m5830sap.su.suInfoTable.suInfoEntry.suAssociation.",device_property("CustomField3"))

returns:
iso.org.dod.internet.private.enterprises.trango.tbw.m5830sap.su.suInfoTable.suInfoEntry.suAssociation.5
 
firebat
Member
Member
Topic Author
Posts: 390
Joined: Mon Apr 11, 2005 8:38 am

Sat May 12, 2007 6:15 am

OK..Not sure what is going on. I messed around some more and tried the original function that wasn't working above and now its working :shock:

((oid(concatenate("iso.org.dod.internet.private.enterprises.trango.tbw.m5830sap.su.suInfoTable.suInfoEntry.suAssociation.",device_property("CustomField3")),30,300,device_property("CustomField2"))))

Who is online

Users browsing this forum: No registered users and 14 guests