Skip to content

SNMP Operations timeout #35

Answered by stsojithomas
stsojithomas asked this question in Q&A
Discussion options

You must be logged in to vote

My bad.. Just had to surround with try/except

async with aiosnmp.Snmp(host=ip_address, port=161, community="public") as snmp:
    try:
        for res in await snmp.get(['oid']):
            print("Response from SNMP Get: {} : {}".format(res.oid, res.value))
    except SnmpTimeoutError:
        print('{}: timeout with device'.format(ip_address))

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by hh-h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant