2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Extend snmp timeout

Default is 1 second, bump to 2 seconds for some
extraordinarily slow switches.  This changes
overall to about 10 seconds as there are, by default,
5 retries.
This commit is contained in:
Jarrod Johnson 2021-10-07 13:03:05 -04:00
parent e52a9ff70f
commit a0ca3d3122

View File

@ -33,9 +33,9 @@ def _get_transport(name):
# Annoyingly, pysnmp does not automatically determine ipv6 v ipv4
res = getaddrinfo(name, 161, 0, socket.SOCK_DGRAM)
if res[0][0] == socket.AF_INET6:
return snmp.Udp6TransportTarget(res[0][4])
return snmp.Udp6TransportTarget(res[0][4], 2)
else:
return snmp.UdpTransportTarget(res[0][4])
return snmp.UdpTransportTarget(res[0][4], 2)
class Session(object):