Code Monkey home page Code Monkey logo

Comments (8)

ValentinBELYN avatar ValentinBELYN commented on August 28, 2024

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.

inviridi avatar inviridi commented on August 28, 2024

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.

ValentinBELYN avatar ValentinBELYN commented on August 28, 2024

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.

inviridi avatar inviridi commented on August 28, 2024

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.

ValentinBELYN avatar ValentinBELYN commented on August 28, 2024

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.

inviridi avatar inviridi commented on August 28, 2024

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.

inviridi avatar inviridi commented on August 28, 2024

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.

ValentinBELYN avatar ValentinBELYN commented on August 28, 2024

Great news! Thank you for your support 😃

from icmplib.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.