etingof / pysnmp

Python SNMP library
http://snmplabs.com/pysnmp/
BSD 2-Clause "Simplified" License
568 stars 188 forks source link

AttributeError: ‘str’ object has no attribute ‘getTagset’ #414

Closed Mertdemiryurek closed 2 years ago

Mertdemiryurek commented 2 years ago

Hi,

When I try to set an object, I took an error like “ AttributeError: ‘str’ object has no attribute ‘getTagset’” . When I search it, I saw SNMP-typed values but I could not use it in my program. Simply my code is:

set(‘IPAdress’,{‘OID’:’value’},hlapi.CommunityData(‘CommunityData’))

Mertdemiryurek commented 2 years ago

I found a solution for that. Actually there is so many answers on the internet but I couldn't understand what to do. The solution is to use SNMP-based variables. For example to set an OctetString you have to write like OctetString("xxx").