diff --git a/checkers/snmp.py b/checkers/snmp.py index 8a76a62..8f668d1 100644 --- a/checkers/snmp.py +++ b/checkers/snmp.py @@ -66,7 +66,6 @@ class SnmpChecker(BaseChecker): temperature_oid = self.config.get("temperature_oid") timeout_val = self.config.get("timeout", 5) - start = time.time() try: with Slim() as slim: # Construit la liste des OIDs à interroger @@ -74,6 +73,7 @@ class SnmpChecker(BaseChecker): if temperature_oid: oids.append(ObjectType(ObjectIdentity(temperature_oid))) + start = time.time() error_indication, error_status, error_index, var_binds = await slim.get( community, host, @@ -82,8 +82,7 @@ class SnmpChecker(BaseChecker): timeout=timeout_val, retries=1 ) - - response_time = (time.time() - start) * 1000 # ms + response_time = (time.time() - start) * 1000 # ms if error_indication: return CheckResult(