diff --git a/openvpn.py b/openvpn.py index 5ac06e4..bbaf964 100644 --- a/openvpn.py +++ b/openvpn.py @@ -160,9 +160,10 @@ class Openvpn: assert self.interface in io_count, "cannot find interface, nic is not there" io_count = io_count[self.interface] open(self.io_stat_fp, "a").write( - f"{datetime.utcnow().timestamp()},{io_count.bytes_recv},{io_count.bytes_recv}\n") + f"{datetime.utcnow().timestamp()},{io_count.bytes_recv},{io_count.bytes_sent}\n") #command = ["ping", "-w", "1", "-c", "1", "8.8.8.8"] - command = ["fping", "-C", "1", "-t200", "-q", "8.8.8.8"] + command = ["fping", "-C", "1", "-t200", + "-I", self.interface, "-q", "8.8.8.8"] p = subprocess.Popen( command, stdout=subprocess.PIPE, stderr=subprocess.PIPE) result = p.communicate()