matt-kimball / mtr-packet-python Goto Github PK
View Code? Open in Web Editor NEWAsynchronous network probes for Python
License: Other
Asynchronous network probes for Python
License: Other
Would this be something you'd accept as a PR?
For example making changes like:
loop.run_until_complete()
to asyncio.run()
.ensure_future()
with the newer asyncio.create_task()
where you'd prefer to not use task groups.Super dope lib btw ๐
Lookin forward to using it in a serious project ๐๐ผ
hi,
you're Getting started code example ends with invalid-argument
:
ProbeResult(success=False, result='invalid-argument', time_ms=None, responder=None, mpls=[])
do I need privileges (root) to use mtrpacket ?
regards, lacsaP.
Upon updating of Arch Linux's Python from 3.10 to 3.11, I found that mtrpacket's tests hang:
$ ./test.sh
.
I have tried to add some debug outputs and located that the hang is near:
out_queue.put_nowait('reply ip-6 ::1 round-trip-time 1000')
result = await mtr.probe('ip6-localhost', ip_version=6)
command = await in_queue.get()
I have tried to replace ip6-localhost
with just localhost
and it passes here, but hangs again after await self.send_probes(mtr, in_queue, out_queue)
.
Any ideas how to proceed here?
Attempting to specify the IP version using the 'ip_version' keyword argument to MtrPacket.probe fails due to problems in the _package_args method which has special handling for the argument at lines 516-518 however later at lines 546-547 the mangled argument keyname is checked against a list that doesn't include 'ip-version' (lines 530-533). One of two things needs to happen for 'ip_version' to work as expected:
I don't know what side effects these options might have, so I cannot suggest which is preferrible.
Hi,
I'm unable to ping.py example. I tried editing my PATH to include the install directory but its still not working.
mtr-packet-python]# python3 ping.py google.com
/bin/sh: mtr-packet: command not found
Traceback (most recent call last):
File "ping.py", line 37, in
loop.run_until_complete(probe_coroutine)
File "/usr/lib64/python3.6/asyncio/base_events.py", line 484, in run_until_complete
return future.result()
File "ping.py", line 13, in probe
async with mtrpacket.MtrPacket() as mtr:
File "/home/mtr-packet-python/mtrpacket/init.py", line 138, in aenter
await self.open()
File "/home/mtr-packet-python/mtrpacket/init.py", line 313, in open
if not await self.check_support('send-probe'):
File "/home/mtr-packet-python/mtrpacket/init.py", line 367, in check_support
(_, args) = await self._command('check-support', check_args)
File "/home/mtr-packet-python/mtrpacket/init.py", line 275, in _command
return await future
mtrpacket.ProcessError: failure to communicate with subprocess "mtr-packet" (is it installed and in the PATH?)
Some system info:
[root@net-tools03 mtr-packet-python]# pip3 list | grep mtrpacket
mtrpacket 1.0.0
[root@net-tools03 mtr-packet-python]# echo $PATH
/home/mtr-packet-python/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
[root@net-tools03 mtr-packet-python]# ls -ltrh
total 28K
-rw-r--r-- 1 root root 1.1K Jun 17 09:21 LICENSE
-rw-r--r-- 1 root root 12K Jun 17 09:21 README.md
drwxr-xr-x 2 root root 75 Jun 17 09:21 examples
-rwxr-xr-x 1 root root 56 Jun 17 09:21 test.sh
drwxr-xr-x 2 root root 39 Jun 17 09:21 test
-rw-r--r-- 1 root root 695 Jun 17 09:21 setup.py
drwxr-xr-x 2 root root 90 Jun 17 09:22 mtrpacket.egg-info
drwxr-xr-x 4 root root 43 Jun 17 09:22 build
drwxr-xr-x 2 root root 39 Jun 17 09:22 dist
-rwxr-xr-x 1 root root 1.1K Jun 17 09:51 ping.py
drwxr-xr-x 3 root root 44 Jun 17 09:51 mtrpacket
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.