Page 1 of 1

Invalid OID. What's wrong with this function?

Posted: Fri May 11, 2007 10:03 am
by firebat
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

Posted: Fri May 11, 2007 1:06 pm
by uldis
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"))

Posted: Fri May 11, 2007 1:07 pm
by winkelman
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]

the dot

Posted: Sat May 12, 2007 1:15 am
by rbmota
I think you have an extra dot '.' at the end. Or missing something, like a 0.

BR

Ricardo Mota

Posted: Sat May 12, 2007 5:48 am
by firebat
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

Posted: Sat May 12, 2007 6:15 am
by firebat
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"))))