Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from ripe.atlas.cousteau import AtlasStream
- import json
- import sys
- def on_result_response(*args):
- print json.dumps(args[0], indent=2)
- def main():
- atlas_stream = AtlasStream()
- atlas_stream.connect()
- channel = "atlas_result"
- atlas_stream.bind_channel(channel, on_result_response)
- stream_parameters = {"prb": sys.argv[1], "type": "traceroute"}
- atlas_stream.start_stream(stream_type="result", **stream_parameters)
- atlas_stream.timeout()
- atlas_stream.disconnect()
- if __name__ == "__main__":
- if len(sys.argv) != 2:
- print "provide a probe ID"
- sys.exit(1)
- main()
Add Comment
Please, Sign In to add comment