Python Forum
how to deal with easysnmp timeout
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to deal with easysnmp timeout
#1
below small script check model of device, its taking ip from file. My issue is ... how to deal with snmp timeout, script exits on snmp time out.

please support.

below small script check model of device, its taking ip from file. My issue is ... how to deal with snmp timeout, script exits on snmp time out.

please support.

#!/usr/bin/python
from easysnmp import Session
community ='public'
oid ='SNMPv2-MIB::sysDescr.0'
with open('DSLAMIP.tx') as f:
for line in f:
session = Session(hostname = line, community = community, version = 2)
snmp_get = session.get(oid)
result = snmp_get.value.encode('ascii')
if 'IES1248-51' in result:
model = 'ZyXEL'
elif 'ECI' in result:
model = 'ECI'
elif 'IP' in result:
model = 'UT'
print line +" "+ model
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  telnetlib timeout kerzol81 0 3,356 Sep-12-2019, 08:38 AM
Last Post: kerzol81

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020