we are trying to run trace route from airflow (in gcp) to get the output
traceroute = subprocess.Popen(["traceroute", '-w', '100','10.10.10.00'],stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
for line in iter(traceroute.stdout.readline,""):
print(line)
but getting below error :
FileNotFoundError: [Errno 2] No such file or directory: 'traceroute'
is there any way to run traceroute from gcp airflow ?
You can use native Python to get the same result as traceroute. You can use pip package mtrpacket and then use the following code. To install a pip package use the
PYPI PACKAGEStab from the composer UI.This code will run without requiring root permissions.