(target, max_hops=20)
| 113 | |
| 114 | |
| 115 | # -------------------------------------------------------------------------- |
| 116 | # Diagnostics: ping / traceroute / mtr / whois / speedtest |
| 117 | # -------------------------------------------------------------------------- |
| 118 | |
| 119 | def do_ping(target, count=4, interface=None): |
| 120 | """Ping `target`. `interface`, if given, pins the probes to that NIC |
| 121 | (ping -I <device>), so a multi-homed box tests the link the caller chose |
| 122 | rather than whatever holds the default route.""" |
| 123 | count = _clamp_int(count, 4, 1, 15) |
| 124 | deadline = count + 3 |
| 125 | cmd = ['ping', '-n', '-c', str(count), '-w', str(deadline)] |
| 126 | if interface: |
no test coverage detected