python - trouble with setting a SNMP attribute using pythone and netsnmp library -


i trying use netsnmp library snmpset attribute error

robm@pc2303vm:~/code/python/snmp$ ./tester2.py   file "./tester2.py", line 5     ipaddr=netsnmp.varbind('.1.3.6.1.2.1.69.1.3.1.0',172.168.100.2,'ipaddress')                                                                ^ syntaxerror: invalid syntax 

now command line

snmpset -v2c -c private 10.1.1.8 .1.3.6.1.2.1.69.1.3.1.0 172.168.100.2 

works fine , quoting "172.168.100.2" gives different error typeerror: expected string or unicode object, nonetype found

#!/usr/bin/python import netsnmp   ipaddr=netsnmp.varbind('.1.3.6.1.2.1.69.1.3.1.0',172.168.100.2,'ipaddress') netsnmp.snmpset(ipaddr, version=2, desthost="10.1.1.8", community="private")  filename=netsnmp.varbind('.1.3.6.1.2.1.69.1.3.2.0', './robertme/q2q_rel_7_2_2_2015_04_07_t1935.bin','string') netsnmp.snmpset(filename, version=2, desthost='10.1.1.8', community='private' ) 

any ideas on how format correctly?


Comments

Popular posts from this blog

css - SVG using textPath a symbol not rendering in Firefox -

Java 8 + Maven Javadoc plugin: Error fetching URL -

node.js - How to abort query on demand using Neo4j drivers -