From 78d240a1fc8fcc2b1b27656bcbec00711e1918a3 Mon Sep 17 00:00:00 2001 From: YuruC3 Date: Fri, 6 Mar 2026 22:59:56 +0100 Subject: [PATCH] Added timeout crash avoidance --- cont/idrac/idrac78.py | 2 -- cont/idrac/idrac9.py | 4 ++++ cont/snmp/walker.py | 4 ++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/cont/idrac/idrac78.py b/cont/idrac/idrac78.py index f8a02d5..baf181f 100644 --- a/cont/idrac/idrac78.py +++ b/cont/idrac/idrac78.py @@ -91,8 +91,6 @@ async def idrac7_8PoolRemote_v3(remoteIP: str, queueToInsrt: asyncio.Queue): snmpEngine.close_dispatcher() - print(voltResult) - # Exhaust CPU1 and CPU2 temp exhaustTemp = None diff --git a/cont/idrac/idrac9.py b/cont/idrac/idrac9.py index 21e62d3..b0b2086 100644 --- a/cont/idrac/idrac9.py +++ b/cont/idrac/idrac9.py @@ -56,6 +56,10 @@ async def idrac9PoolRemote_v3(remoteIP: str, queueToInsrt: asyncio.Queue): errorIndication, errorStatus, errorIndex, mainVarBinds = await iterator if errorIndication: + if errorIndication == "No SNMP response received before timeout": + print(f"Host {remoteIP} timed out.\nContinuing...") + snmpEngine.close_dispatcher() + return 1 print(errorIndication) elif errorStatus: print( diff --git a/cont/snmp/walker.py b/cont/snmp/walker.py index 6f44f64..808a348 100644 --- a/cont/snmp/walker.py +++ b/cont/snmp/walker.py @@ -53,6 +53,10 @@ async def walk_column_v3(snmpEngine, remoteIP: str, base_oid: str) -> dict: lexicographicMode=False, ): if errInd: + print(f"\n\n{errInd}\n\n") + if "No SNMP response received before timeout" in errInd: + print(f"Host {remoteIP} timed out.\nContinuing...") + return 1 raise RuntimeError(errInd) if errStat: raise RuntimeError(errStat.prettyPrint())