net-snmp-python

Matt matt.mailinglists at gmail.com
Sat Apr 1 20:39:53 EDT 2017


Does anyone have an example of using netsnmp library to do a snmpset
on a snmp v2 device?  I have gotten snmpget to work fine with python I
just cannot get snmpset to work.  I know I have the snmp device
configured correctly with read/write access since I can use snmpset on
the linux(centos7) command line to successfully make changes to the
device.

This is on python 2.7.5 stock version included with Centos 7.

The below works fine to do a snmpwalk but I need to do a snmpset on
different variable.

import netsnmp

oid = netsnmp.Varbind('sysDescr')

result = netsnmp.snmpwalk(oid,
  Version = 2,
  DestHost="localhost",
  Community="public")

print result


More information about the Python-list mailing list