From a0ca3d31220c64207d7344dd2366fdf8bd9dd322 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 7 Oct 2021 13:03:05 -0400 Subject: [PATCH] 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. --- confluent_server/confluent/snmputil.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/snmputil.py b/confluent_server/confluent/snmputil.py index 05090947..611b3831 100644 --- a/confluent_server/confluent/snmputil.py +++ b/confluent_server/confluent/snmputil.py @@ -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):