Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use OS-independent ping #10

Open
upa opened this issue Jul 14, 2018 · 5 comments
Open

Use OS-independent ping #10

upa opened this issue Jul 14, 2018 · 5 comments

Comments

@upa
Copy link
Owner

upa commented Jul 14, 2018

The current implementation uses ping commands on OSes. However, their options are different and sometimes changed (e.g., on ubuntu 18.04). So, we need to use OS-independent ping.

Which is a better way for achieving it?

@Lapshin
Copy link

Lapshin commented Jul 18, 2018

I think using scapy will be good solution. But a bit difficult than ping and libpcap must included on system

@keiichishima
Copy link

I don't know how much seriously it is maintained, but there is a guy who implemented ping using Python.
https://github.com/satoshi03/pings

@upa
Copy link
Owner Author

upa commented Oct 9, 2018

Implementing ping uing python is a reasonable way. I will try to integrate it or impelement ping when I have time :-)

btw, I tried to use scapy when I started to write deadman. Unfortunately, scapy-based ping involved 'long time' to build, send, and receive icmp packets. It spoils accuracy of RTT, so I gave up on using scapy.

@fkztw
Copy link

fkztw commented Apr 22, 2020

Traceback (most recent call last):
  File "./deadman", line 727, in <module>
    curses.wrapper(main, args.configfile)
  File "/usr/lib/python3.8/curses/__init__.py", line 105, in wrapper
    return func(stdscr, *args, **kwds)
  File "./deadman", line 702, in main
    deadman.main()
  File "./deadman", line 601, in main
    target.send()
  File "./deadman", line 109, in send
    res = self.ping.send()
  File "./deadman", line 239, in send
    r = subprocess.check_output(cmd, stderr = subprocess.DEVNULL,
  File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/lib/python3.8/subprocess.py", line 489, in run
    with Popen(*popenargs, **kwargs) as process:
  File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'ping6'

I'm using Arch Linux and got this error message after running deadman.
After searching, it turns out ping command on Arch Linux also has IPv6 function.
So, there's no ping6 on Arch Linux.
I just create a soft link in ~/.local/bin/ping6 with /usr/bin/ping to solve the problem with: ln -s /usr/bin/ping ~/.local/bin/ping6

Definitely related to this issue.
Just want to let you know and who might encounter the same problem as me.

BTW, This is a great project. Thanks for you guys.

@Superbil
Copy link

Superbil commented Apr 29, 2020

I found that problem ping6 had been merge into ping.
ref: ping: merge ping6 command into ping

Maybe we had to check ping6 command isn't existed, than change to use ping -6. Ether change to use ping -6 replace ping6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants