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

assert_ping relies on the os ping binary #56

Open
brunobord opened this issue Apr 15, 2014 · 2 comments
Open

assert_ping relies on the os ping binary #56

brunobord opened this issue Apr 15, 2014 · 2 comments

Comments

@brunobord
Copy link

The current ping util relies on the ping command line util. I'm not sure it's a good idea to rely on the operating system and subprocess command output there. I've searched a bit and found a pure-python implementation of the ping (ICMP) protocol.

If you are okay with this idea, I may try to see if it's doable to replace the ping call with it (at the moment, it's not very clear).

@benoitbryon
Copy link
Member

The current ping util relies on the ping command line util. I'm not sure it's a good idea to rely on the operating system and subprocess command output there.

Agreed. It could be improved.

I've searched a bit and found a pure-python implementation of the ping (ICMP) protocol.
If you are okay with this idea, I may try to see if it's doable to replace the ping call with it.

I'm ok with the idea.
Also have a look at https://pypi.python.org/pypi?%3Aaction=search&term=ping&submit=search

Notice that some sources (like https://pypi.python.org/pypi/pyping/0.0.4) mention that "ICMP messages can only be sent from processes running as root"...
If I have to choose between using subprocess VS running as root, I would keep on running subprocess ;)

Or perhaps have a look at scapy's ping features. Hospital may not depend on scapy, but perhaps we could document recipes to use scapy's features within healthchecks.

@brunobord
Copy link
Author

I knew ping wasn't easy.

I've tested pyping with or without the udp flag, same result: Permission denied. You have to be root.
I agree: having to run ping checks as root is a no-go. Maybe this feature is not a good idea after all...

But I'm wondering: if you have to be root to send ICMP packages, how is it possible to run "ping" as a normal user and get results?

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

2 participants