You can use a Python script to obtain the OID of a specified leaf node.
# Obtain the OID of a specified leaf node.
opsObj.snmp.get(oid)
# Obtain the OID of the next hop node of a specified leaf node.
opsObj.snmp.getnext(oid)
test.py import ops opsObj = ops.ops() curValue, ret = opsObj.snmp.get("1.3.6.1.2.1.2.2.1.1") print("ret is ", ret, " and current value of OID is ", curValue, "\n") nextVal, nextOid, ret = opsObj.snmp.getnext("1.3.6.1.2.1.2.2.1.1") print("ret is ", ret, " the next OID of the current OID is ", nextOid, " and the corresponding value is ", nextVal, "\n")
This API is used to obtain the OID of a specified leaf node and the OID of the next node.