Comments (11)
Hi @HardipinderS!
The problem you see is really strange. Can you tell me which operating system you are using as well as its version?
Moreover, what are the parameters transmitted to the multiping
function?
Finally, what are the values of IPPROTO_ICMP
and IPPROTO_ICMPV6
under Python 3.7.9 and Python 3.9.5? IPPROTO_ICMP
with IPv6 sockets should not work.
Regarding your second question, the multiping
function was designed to be very efficient on a large number of hosts. You can ping over 1000 hosts in just seconds! This shouldn't be a problem for 70 servers π
from icmplib.
I would love to be a part of that. I will try that out and let you know how it prevails.
It was nice working with you, and happy to answer all your questions, it was the only way to get to the bottom of it. Just wanted to let you know that you codebase will be utilised in an automation and hopefully if things go as planned, in Django backend too that is part of Wipro . So, Wanted to say really thankful for your dedicated effort. If I can contribute to your work in any way let me knowπ
from icmplib.
Hi! Sorry for the delay. I am currently preparing the release of version 3 of icmplib.
I'm glad you enjoy this library! It is in this kind of remark that I draw my motivation β€οΈ. Hope you enjoy the next version as much! It will be released on June 1st.
from icmplib.
Hi @HardipinderS!
The problem you see is really strange. Can you tell me which operating system you are using as well as its version?
Moreover, what are the parameters transmitted to the
multiping
function?Finally, what are the values of
IPPROTO_ICMP
andIPPROTO_ICMPV6
under Python 3.7.9 and Python 3.9.5?IPPROTO_ICMP
with IPv6 sockets should not work.Regarding your second question, the
multiping
function was designed to be very efficient on a large number of hosts. You can ping over 1000 hosts in just seconds! This shouldn't be a problem for 70 servers π
First of all thank you for replying so quickly.
The error occurred on windows 10 and windows 2016 server os.
Parameters were as per the example just the ips. I tried adding count and payload but same error occurred. I believe it was the socket creation that caused the problem. Because when I did
- "dir(socket)"
It never showed IPPROTOV6
True, ipv6 won't work, but if we have a condition statement that checks if the ip entered is v6 or v4 that might solve the issue. I would suggest explicitly as per Zen, but if we want implicit, I don't exactly remember, but python has an inbuild library for checking. EDIT: Found the module it is ipaddress (https://stackoverflow.com/a/56038331)
Let me know what you think.
And thanks for the clarification of multiping, I wanted expert advise, so that helpsπ
from icmplib.
Can you give me the result of dir(socket)
under Python 3.7.9 and 3.9.5? It may just be a bug present in Python 3.7.9 version of Windows. I will also do some tests today.
If I understood correctly, you only encounter this problem when using IPv6 addresses?
Otherwise, it is normal if IPPROTO_IPV6
is not present on Windows. A fix has already been set up for this constant: https://github.com/ValentinBELYN/icmplib/blob/main/icmplib/sockets.py#L547
And there is already a condition to check the type of IP address π: https://github.com/ValentinBELYN/icmplib/blob/main/icmplib/ping.py#L133
from icmplib.
hey,
I thought the same, but was not sure if changing anything or raising a bug in 3.7.9 will be beneficial, as they're planning mostly to push towards 3.10 and 4 eventually.
dir(socket) result =
['AF_APPLETALK', 'AF_DECnet', 'AF_INET', 'AF_INET6', 'AF_IPX', 'AF_IRDA', 'AF_SNA', 'AF_UNSPEC', 'AI_ADDRCONFIG', 'AI_ALL', 'AI_CANONNAME', 'AI_NUMERICHOST', 'AI_NUMERICSERV', 'AI_PASSIVE', 'AI_V4MAPPED', 'AddressFamily', 'AddressInfo', 'CAPI', 'EAGAIN', 'EAI_AGAIN', 'EAI_BADFLAGS', 'EAI_FAIL', 'EAI_FAMILY', 'EAI_MEMORY', 'EAI_NODATA', 'EAI_NONAME', 'EAI_SERVICE', 'EAI_SOCKTYPE', 'EBADF', 'EWOULDBLOCK', 'INADDR_ALLHOSTS_GROUP', 'INADDR_ANY', 'INADDR_BROADCAST', 'INADDR_LOOPBACK', 'INADDR_MAX_LOCAL_GROUP', 'INADDR_NONE', 'INADDR_UNSPEC_GROUP', 'IPPORT_RESERVED', 'IPPORT_USERRESERVED', 'IPPROTO_ICMP', 'IPPROTO_IP', 'IPPROTO_RAW', 'IPPROTO_TCP', 'IPPROTO_UDP', 'IPV6_CHECKSUM', 'IPV6_DONTFRAG', 'IPV6_HOPLIMIT', 'IPV6_HOPOPTS', 'IPV6_JOIN_GROUP', 'IPV6_LEAVE_GROUP', 'IPV6_MULTICAST_HOPS', 'IPV6_MULTICAST_IF', 'IPV6_MULTICAST_LOOP', 'IPV6_PKTINFO', 'IPV6_RECVRTHDR', 'IPV6_RECVTCLASS', 'IPV6_RTHDR', 'IPV6_TCLASS', 'IPV6_UNICAST_HOPS', 'IPV6_V6ONLY', 'IP_ADD_MEMBERSHIP', 'IP_DROP_MEMBERSHIP', 'IP_HDRINCL', 'IP_MULTICAST_IF', 'IP_MULTICAST_LOOP', 'IP_MULTICAST_TTL', 'IP_OPTIONS', 'IP_RECVDSTADDR', 'IP_TOS', 'IP_TTL', 'IntEnum', 'IntFlag', 'MSG_BCAST', 'MSG_CTRUNC', 'MSG_DONTROUTE', 'MSG_ERRQUEUE', 'MSG_MCAST', 'MSG_OOB', 'MSG_PEEK', 'MSG_TRUNC', 'MSG_WAITALL', 'MsgFlag', 'NI_DGRAM', 'NI_MAXHOST', 'NI_MAXSERV', 'NI_NAMEREQD', 'NI_NOFQDN', 'NI_NUMERICHOST', 'NI_NUMERICSERV', 'RCVALL_MAX', 'RCVALL_OFF', 'RCVALL_ON', 'RCVALL_SOCKETLEVELONLY', 'SHUT_RD', 'SHUT_RDWR', 'SHUT_WR', 'SIO_KEEPALIVE_VALS', 'SIO_LOOPBACK_FAST_PATH', 'SIO_RCVALL', 'SOCK_DGRAM', 'SOCK_RAW', 'SOCK_RDM', 'SOCK_SEQPACKET', 'SOCK_STREAM', 'SOL_IP', 'SOL_SOCKET', 'SOL_TCP', 'SOL_UDP', 'SOMAXCONN', 'SO_ACCEPTCONN', 'SO_BROADCAST', 'SO_DEBUG', 'SO_DONTROUTE', 'SO_ERROR', 'SO_EXCLUSIVEADDRUSE', 'SO_KEEPALIVE', 'SO_LINGER', 'SO_OOBINLINE', 'SO_RCVBUF', 'SO_RCVLOWAT', 'SO_RCVTIMEO', 'SO_REUSEADDR', 'SO_SNDBUF', 'SO_SNDLOWAT', 'SO_SNDTIMEO', 'SO_TYPE', 'SO_USELOOPBACK', 'SocketIO', 'SocketKind', 'SocketType', 'TCP_FASTOPEN', 'TCP_MAXSEG', 'TCP_NODELAY', '_GLOBAL_DEFAULT_TIMEOUT', '_GiveupOnSendfile', '_LOCALHOST', '_LOCALHOST_V6', 'all', 'builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'spec', '_blocking_errnos', '_intenum_converter', '_realsocket', '_socket', 'close', 'create_connection', 'dup', 'errno', 'error', 'errorTab', 'fromfd', 'fromshare', 'gaierror', 'getaddrinfo', 'getdefaulttimeout', 'getfqdn', 'gethostbyaddr', 'gethostbyname', 'gethostbyname_ex', 'gethostname', 'getnameinfo', 'getprotobyname', 'getservbyname', 'getservbyport', 'has_ipv6', 'herror', 'htonl', 'htons', 'inet_aton', 'inet_ntoa', 'inet_ntop', 'inet_pton', 'io', 'ntohl', 'ntohs', 'os', 'selectors', 'setdefaulttimeout', 'socket', 'socketpair', 'sys', 'timeout']
"Thought it might be easier compared to screenshot "
No no, the problem is while using normal ips(IPv4) itself, I don't think I'll ever be able to utilize IPv6 in my current company.
For the rest I guess you were one step ahead of me ;D
I'll have to go through your code to know if something is getting missed, But as of now, changing it to IPPROTO_ICMP fixed the issue for me
from icmplib.
There is something that I do not understand. If you don't use an IPv6 address, why are you getting this kind of error...
If you are using the multiping
function with only one IP address (ex: multiping(['1.1.1.1'])
), do you have this same problem?
Now, if you use the ping
function this time with the same IP address (ex: ping(['1.1.1.1'])
), are you experiencing the same phenomenon?
Thanks in advance!
from icmplib.
I have done a lot of tests under different versions of Python on Windows and I have not encountered any problem with the multiping
function. Can you give me the IP addresses you are having trouble with?
However, I have located a bug with IPv6 under Python 3.7 and it is now fixed.
from icmplib.
Let me start by saying sorry for the delayed reply. Been busy with few things.
Answering your questions in order, happens with multiping only. happens both times with one ip address and multiple ip addresses. Happens only in 3.7.9.
I commend your effort, but the moment I run it with 3.7.9, the problem occurs. The ip addresses were as per your example in the first try. Second try was two ip address[192.168.38.163, 192.168.45.146]. Third try was these two with addition of ::1 and fourth, was deletion of ::1 and addition two ips 192.168.38.172 and 192.168.45.147. But all gave me save attributeerror. And once I changed the error part in your codebase, it worked.
I know this not what you were hoping to hear, but I hope this might have helped in bringing clarity on the issue.
You mentioned you got the bug fixed in 3.7. First of all, wow. Second, if you don't mind my asking, how?
from icmplib.
It's pretty reassuring that the problem isn't affecting other functions, even though I can't reproduce the behavior.
For the version 3.0 of icmplib which will be released this weekend, I notably integrated a brand new implementation of the multiping
function which should also fix your problem.
If you want to test in the meantime, you can follow these instructions:
# Uninstall icmplib
pip3 uninstall icmplib
# Download and extract this repository:
# https://github.com/ValentinBELYN/icmplib/archive/main.tar.gz
# Go to the extracted directory
# Install the version under development
python3 setup.py install
Regarding the bug affecting IPv6, it has been fixed here: 6bfb44a
If you have time, don't hesitate to give me a feedback! ... and sorry for all the questions I asked you π
from icmplib.
icmplib 3.0 is available for download! π
Your problem should now be resolved!
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.