Comments (8)
Hi @inviridi,
Thank you for your compliments!
Did you follow the procedure described here? https://github.com/ValentinBELYN/icmplib/blob/main/docs/6-use-icmplib-without-privileges.md
When you set the privileged
parameter to False
, the kernel handles some parts of the ICMP headers.
If you still get the SocketPermissionError
exception after setting the privileged
parameter to False
, that doesn't mean the option has no effect. It's just that your system does not allow you to use this feature (unless you follow the above procedure).
I have to modify the SocketPermissionError
message which is not very explicit!
Regarding your second problem, maybe asyncio works differently in your environment. We can deal with this problem later if you want.
from icmplib.
Hi Valentin,
Thanks for taking the time to answer! I followed the procedure described you linked... still no success.
(base) fl@tuxedo:~> echo 'net.ipv4.ping_group_range = 0 2147483647' | sudo tee -a /etc/sysctl.conf
[sudo] password for root:
net.ipv4.ping_group_range = 0 2147483647
(base) fl@tuxedo:~> sysctl -p
tuxedo:~ # sysctl -p
net.ipv6.conf.all.disable_ipv6 = 1# added by Insync
fs.inotify.max_user_watches = 1048576
net.ipv4.ping_group_range = 0 2147483647
Any idea what could be the reason for the above message? I run an Opensuse 15.3 Linux with up-to-date packages.
I did some reading about why this is all so difficult: disappointing stuff. But I am grateful that you tackled the problem with icmplib! If we cannot get this to work that would be acceptable for me, too. It is just a side endeavour to check whether my IoT-logger can still reach the internet.
from icmplib.
I did a lot of tests on different versions of openSUSE, including openSUSE 15.3 and Python 3.9 without being able to reproduce your problems.
As you can see below, this works well for the privileged
parameter and the multiping
function:
valentin@localhost:~> cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"
valentin@localhost:~> python3.9
Python 3.9.5 (default, May 05 2021, 15:23:13) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from icmplib import ping, multiping, __version__
>>> __version__
'3.0'
>>> ping('google.com', privileged=False)
<Host [142.250.179.78]>
>>> multiping(['google.com'], privileged=False)
[<Host [142.250.179.78]>]
Your issues may be related to the Anaconda environment you are using. Unfortunately, not using it, I cannot tell you more about it.
from icmplib.
What an interesting turn of events! I could reproduce all your commands in the REPL...
(mib) fl@tuxedo:~/SW/MIB/crate/bin> python3.9
Python 3.9.5 (default, Jun 4 2021, 12:28:51)
[GCC 7.5.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from icmplib import ping, multiping, __version__
>>> __version__
'3.0'
>>> ping('google.com', privileged=False)
<Host [64.233.184.102]>
>>> multiping(['google.com'], privileged=False)
[<Host [64.233.184.139]>]
...but get the same error when I execute the Python file. Will definitely have a closer look and report back.
from icmplib.
Hi! I hope you have solved your problem. Do not hesitate to give me a feedback 😉
In the meantime, I close this issue since it is not related to this library.
from icmplib.
Thank you for your swift answers and understanding. I will definitely investigate this issue further and get back to you shall questions arise. Cheers!
from icmplib.
Hi Valentin, I found some time this weekend to rework my project and wanted to let you know that it works beautifully now. The only major change I applied was switching the environment manager from conda to pdm. I was reluctant to do so due to my long history and experience with the former but what can I say... your library works as expected now. Thanks a lot for writing it and all the best to you!
from icmplib.
Great news! Thank you for your support 😃
from icmplib.
Related Issues (20)
- Enhancement: class Host to return a dict with it's data HOT 1
- The regular time.time() function does not work well in Windows, rtt = 0 HOT 2
- Can only receive the last hop using traceroute on Windows HOT 3
- The future of icmplib
- traceroute only provides last hop HOT 1
- samsung.com - Packetloss 100.0% HOT 1
- Add the ability to set the DF flag and get MTU size feedback from the ICMP protocol.
- Actual license is unclear: is it LGPLv3 or LGPLv3+? HOT 1
- Add reply payload retrieval and checking HOT 1
- The traceroute under ipv6 only displays the last hop HOT 5
- Whats the difference between icmpLib and the icmpLibv2(forked from IcmpLib) ? HOT 3
- Use predefined socket either SOCK_DGRAM / SOCK_RAW on every invocation of ping API HOT 1
- After upgrading to ubuntu 22.04 sysctl changes are needed again HOT 3
- Feature: auto-detect best "privileged" setting HOT 3
- Feature: unprivileged traceroute HOT 4
- Error on running very basic Ping command HOT 1
- Running traceroute only returns final hop HOT 1
- Make payload more flexible HOT 2
- Unnecessary last `sleep()` in `multiping()` HOT 2
- Feature: Async traceroute
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from icmplib.