astrikos / ripe-atlas-cmdline Goto Github PK
View Code? Open in Web Editor NEWCommand line interface for RIPE Atlas API
Command line interface for RIPE Atlas API
According to the documentation, protocol (UDP/ICMP) is required. Indeed, the tools asks the user for it but does not put it in the JSON request:
% python ripe-atlas-cmdline/atlas_manage.py oneoff -f ~/.atlas/auth -s
Specify Target:192.134.92.1
Specify Type:traceroute
Specify Traceroute Protocol[ICMP/UDP]:UDP
Specify Protocol[4/6]:4
Specify Description:Test 192.134.92.1
Is it OneOff y/n:y
Do you need any additional options y/n:n
Specify Start Time [Unix Timestamp\Leave blank for now]:
Specify Number of Probes (Integer):100
Specify Probes Source Type [area/country/prefix/asn/probes/msm]:area
Specify Probes Source [WW/West/North-Central/South-Central/North-East/South-East]:North-Central
You are about to create a new oneoff RIPE Atlas UDM with the following details:
{'definitions': [{'description': 'Test 192.134.92.1', 'type': 'traceroute', 'target': '192.134.92.1', 'is_oneoff': 'true', 'af': 4}], 'probes': [{'requested': 100, 'type': 'area', 'value': 'North-Central'}]}
Problem with HTTP request.
Traceback (most recent call last):
File "/home/stephane/src/RIPE-Atlas/ripe-atlas-cmdline/commands/create.py", line 167, in create
response = urllib2.urlopen(req, post_data)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 407, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 445, in error
return self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: BAD REQUEST
% ./atlas_manage.py oneoff -f ~/.atlas/auth
Specify Target:207.249.67.253
Specify Type:dns
Specify Protocol[4/6]:4
Specify Description:DNS test of ns1.infoacces.net
Is it OneOff y/n:y
Do you need any additional options y/n:y
Specify option:query_type
Specify value:MX
More y/n:y
Specify option:query_argument
Specify value:mexis.net
More y/n:y
Specify option:query_class
Specify value:IN
More y/n:n
Specify Start Time [Unix Timestamp\Leave blank for now]:
Specify Number of Probes (Integer):200
Specify Probes Source Type [area/country/prefix/asn/probes/msm]:area
Specify Probes Source [WW/West/North-Central/South-Central/North-East/South-East]:WW
You are about to create a new oneoff RIPE Atlas UDM with the following details:
{'definitions': [{'description': 'DNS test of ns1.infoacces.net ', 'af': 4, 'query_argument': 'mexis.net', 'query_type': 'MX', 'query_class': 'IN', 'type': 'dns', 'is_oneoff': 'true', 'target': '207.249.67.253'}], 'probes': [{'requested': 200, 'type': 'area', 'value': 'WW'}]}
A new oneoff UDM just created with id: 1012182
Sleeping for 10 secs in order to give some time to Atlas to produce data...
Seems we got more than 90% (199) of requested probes, sleeping for 5 more secs to be sure we get the maximum probes Atlas can give us.
Traceback (most recent call last):
File "./atlas_manage.py", line 25, in
sys.exit(main())
File "./atlas_manage.py", line 21, in main
class_object.run()
File "/home/bortzmeyer/Programmation/RIPE-Atlas/ripe-atlas-cmdline/commands/oneoff.py", line 63, in run
if self.get_probes_number():
File "/home/bortzmeyer/Programmation/RIPE-Atlas/ripe-atlas-cmdline/commands/oneoff.py", line 95, in get_probes_number
self.url_results = 'https://atlas.ripe.net%s' % metadata['result']
KeyError: 'result'
% ./atlas_manage.py oneoff -f ~/.atlas/auth
Specify Target:207.249.67.253
Specify Type:dns
Specify Protocol[4/6]:4
Specify Description:DNS test of ns1.infoacces.net
Is it OneOff [y/n]:
Why asking since the actual command name already shows I want a oneoff measurement?
DNS tests require some options such as the query name. The program does not ask for them and, as a result:
ou are about to create a new oneoff RIPE Atlas UDM with the following details:
{'definitions': [{'description': 'DNS test of ns1.infoacces.net ', 'type': 'dns ', 'target': '207.249.67.253', 'is_oneoff': 'true', 'af': 4}], 'probes': [{'requested': 200, 'type': 'area', 'value': 'WW'}]}
Problem with HTTP request.
Traceback (most recent call last):
File "/home/bortzmeyer/Programmation/RIPE-Atlas/ripe-atlas-cmdline/commands/create.py", line 167, in create
response = urllib2.urlopen(req, post_data)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 407, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 445, in error
return self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 400: BAD REQUEST
If I reply by just Enter when asked:
Specify Probes Source Type [area/country/prefix/asn/probes/msm]:
Specify Probes Source:
An incorrect request is created:
You are about to create a new oneoff RIPE Atlas UDM with the following details:
{'definitions': [{'description': 'Test cmd line', 'type': 'ping', 'target': 'www.nic.fr', 'is_oneoff': 'true', 'af': 4}], 'probes': [{'requested': 5, 'type': '', 'value': ''}]}
and it crashes (but does not detect it and still requests the results)
Problem with HTTP request.
Traceback (most recent call last):
File "/home/bortzmeyer/Programmation/RIPE-Atlas/ripe-atlas-cmdline/commands/create.py", line 167, in create
response = urllib2.urlopen(req, post_data)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 407, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 445, in error
return self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 500: INTERNAL SERVER ERROR
Sleeping for 10 secs in order to give some time to Atlas to produce data...
Problem with HTTP request.
Traceback (most recent call last):
File "/home/bortzmeyer/Programmation/RIPE-Atlas/ripe-atlas-cmdline/commands/init.py", line 40, in http_get
response = urllib2.urlopen(req)
File "/usr/lib/python2.7/urllib2.py", line 127, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.7/urllib2.py", line 407, in open
response = meth(req, response)
File "/usr/lib/python2.7/urllib2.py", line 520, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.7/urllib2.py", line 445, in error
return self._call_chain(_args)
File "/usr/lib/python2.7/urllib2.py", line 379, in _call_chain
result = func(_args)
File "/usr/lib/python2.7/urllib2.py", line 528, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
HTTPError: HTTP Error 404: NOT FOUND
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.