Sample Header Ad - 728x90

Python and snmpset with netsnmp

-1 votes
1 answer
2693 views
On the linux command line, centos 7, I can to do this to change an snmp setting on a device. snmpset -v 2c -c private 172.16.1.2 .1.3.6.1.2.1.1.5.0 s new_name With python and netsnmp I can read the values I just cannot seem to change them. import netsnmp line = "172.16.1.2" snmp_string = "private" oid = netsnmp.Varbind('.1.3.6.1.2.1.1.5.0') result = netsnmp.snmpget(oid, Version = 2, DestHost=line, Community=snmp_string) print result The above works fine to read the value can anyone tell me how to write to the value with python preferably using netsnmp?
Asked by Matt (49 rep)
Apr 2, 2017, 07:49 PM
Last activity: Aug 9, 2024, 12:01 AM