diff --git a/sla/device.py b/sla/device.py index c6cff75..2225fa6 100644 --- a/sla/device.py +++ b/sla/device.py @@ -3,7 +3,8 @@ ConnectHandler, NetmikoTimeoutException, NetmikoAuthenticationException, - BaseConnection + BaseConnection, + ReadTimeout ) import textfsm from sla.logger import LG @@ -96,9 +97,15 @@ def __batch_remote_check(self, hnd: BaseConnection, targets: list, fsm: textfsm. sleep(target.delay) _ = None command: str = self.__create_rtt_command(target.target) - result = hnd.send_command(command) - LG.debug(f"RTT command sent to {self.name} device") + try: + result = hnd.send_command(command) + except ReadTimeout: + LG.debug(f"ReadTimeout error on {self.name} device for {target.target} target") + continue # Ignore ReadTimeout error and continue checking + LG.debug(f"Command [{command}] sent to {self.name} device") + LG.debug(f"Recieved [{result}] from {self.name} device") output = fsm.ParseText(result) + LG.debug(f"Parsed data [{output}] from {self.name} device") try: rtt = float(output[iter][0]) except IndexError as ex: diff --git a/sla/sla.py b/sla/sla.py index 566b945..567c508 100644 --- a/sla/sla.py +++ b/sla/sla.py @@ -138,7 +138,7 @@ def __collect(self): while True: with Lock(): REGISTRY.collect() - LG.debug(f"Registry collection finished with delay time {_} s") + LG.info(f"Registry collection finished with delay time {_} s") sleep(_) def _run(self):