MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / do_traceroute

Function do_traceroute

network_diagnostics.py:115–123  ·  view source on GitHub ↗
(target, max_hops=20)

Source from the content-addressed store, hash-verified

113
114
115# --------------------------------------------------------------------------
116# Diagnostics: ping / traceroute / mtr / whois / speedtest
117# --------------------------------------------------------------------------
118
119def 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:

Callers 1

net_tracerouteFunction · 0.85

Calls 2

_clamp_intFunction · 0.85
_runFunction · 0.85

Tested by

no test coverage detected