NetXMS Support Forum

English Support => General Support => Topic started by: lhpaladin on May 04, 2024, 02:16:56 AM

Title: snmpOID is no longer returning the OID starting with dot
Post by: lhpaladin on May 04, 2024, 02:16:56 AM
Hi,

$node.snmpOID
is no longer returning the OID starting with dot (.) , many scripts will need adjustments in version 5.0.
Is it a bug or implementation change?
Title: Re: snmpOID is no longer returning the OID starting with dot
Post by: Filipp Sudanov on May 04, 2024, 10:07:30 AM
This is intended change. We keep list of breaking changes in the documentation, it's worth checking prior to upgrade:
https://www.netxms.org/documentation/adminguide/installation.html#major-changes-between-releases
Title: Re: snmpOID is no longer returning the OID starting with dot
Post by: lhpaladin on May 05, 2024, 05:27:25 AM
Thanks for the answer. It's better
Title: Re: snmpOID is no longer returning the OID starting with dot
Post by: gkaudewitz on May 10, 2024, 12:12:43 PM
Does this mean, that using OIDs in SNMP-requests as functionparameter also have to be done without leading "."?

What is the behavior if result of a SNMP-request is an OID itsself? Is this value returned without leading "."?
Title: Re: snmpOID is no longer returning the OID starting with dot
Post by: Filipp Sudanov on May 10, 2024, 03:16:00 PM
NXSL functions accept OIDs both with and without the leading dot. Returned values are without the dot. So both of below lines will print "System description: 1.3.6.1.4.1.14988.1"

println("System description: " .. $node.createSNMPTransport()?.getValue(".1.3.6.1.2.1.1.2.0") );
println("System description: " .. $node.createSNMPTransport()?.getValue("1.3.6.1.2.1.1.2.0") );


?. is safe dereference which appeared in 5.0 - should createSNMPTransport() return null, this will not produce script error.