diff --git a/check_iperf3.py b/check_iperf3.py index abf6f28..ebdf20d 100755 --- a/check_iperf3.py +++ b/check_iperf3.py @@ -197,10 +197,11 @@ def determine_result(options, json_data) -> Tuple[int, Optional[List[str]]]: statuslines.append("transfer rate below warning threshold") if not options.udp and options.retrans_crit and options.retrans_warn: - if json_data["end"]["sum_sent"]["retransmits"] >= options.retrans_crit: + retransmits = json_data["end"]["sum_sent"]["retransmits"] + if retransmits >= options.retrans_crit: rc = max(rc, 2) statuslines.append("retransmissions over critical threshold") - elif json_data["end"]["sum_sent"]["retransmits"] >= options.retrans_warn: + elif retransmits >= options.retrans_warn: rc = max(rc, 1) statuslines.append("retransmissions over warning threshold")