You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to do a generic SNMP Subtree, but I am having problems with OctetString conversion:
MAC Adresses are decoded with .toString('hex')
Text is decoded with .toString('utf8')
My code is the following:
this.connection.subtree(oid,(varbinds: Array<any>)=>{varbinds.forEach(varbind=>{if(snmp.isVarbindError(varbind))message.push({'oid': varbind.oid,'value': snmp.varbindError(varbind)})else{if(varbind['type'])varbind['type']=snmp.ObjectType[varbind['type']]// How to make this statement generic?if(varbind['value']instanceofBuffer)varbind['value']=varbind['value'].toString("hex")message.push(varbind)}})})
I want to do a generic SNMP Subtree, but I am having problems with OctetString conversion:
.toString('hex')
.toString('utf8')
My code is the following:
And my responses are:
The expected
snmpget
responses are:How can I distinguish one from the other and create a generic subtree function with correct string conversion?
The text was updated successfully, but these errors were encountered: