trying to convert this line in to pysnmp
snmpset -v 2c -On -r 5 -t 2 -c private ip-address .1.3.6.1.2.1.2.2.1.7.369098771 i 1
I am trying to take a working walk function and modify it but my knowledge with SNMP makes it very hard to understand pysnmp doc
this is just part of the code
from pysnmp.entity.rfc3413.oneliner import cmdgen
device_target = (self.ip, self.port)
res = None
# Create a PYSNMP cmdgen object
cmd_gen = cmdgen.CommandGenerator()
(error_detected, error_status, error_index, snmp_data) = cmd_gen.setCmd(
cmdgen.CommunityData(community_string),
cmdgen.UdpTransportTarget(device_target), '.1.3.6.1.2.1.2.2.1.7.369098771', 1
lookupNames=True, lookupValues=True)
I know I am missing something, can any one help please