I'm trying to write a program that manages a complex of devices via SNMP. I use Python 3 as a programming language. Reading SNMP variables from managed devices is fine. It is impossible to execute netsnmp.snmpset in any way . Example:
>>> import netsnmp >>> x1 = '11:22:33:44:55:66' >>> ss = netsnmp.Session(Version = 2, DestHost = '172.17.132.73', Community="public") >>> tag = '.1.3.6.1.4.1.<Моя фирма>.5.1.2.1.3.10.1' >>> vb = netsnmp.Varbind(tag, '0', x1, 'STRING') >>> snmpe = netsnmp.snmpset(vb, ss) The following error is displayed:
Traceback (innermost last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python3.5/dist-packages/netsnmp/client.py", line 246, in snmpset var_list.append(Varbind(arg)) File "/usr/local/lib/python3.5/dist-packages/netsnmp/client.py", line 64, in __init__ match = regex.match(tag) TypeError: expected string or bytes-like object
If you look at the outcomes indicated in the presentation, you can see that the abuse goes to the tag field in the vb object. But he - just STRING !!!. So the meaning of the error message is completely incomprehensible to me. I tried to remove the starting point in the OID, I tried to add the "0" at the end myself - no effect.
What kind of mystic?