The `multiping` library is a pure Python implementation for sending and receiving ICMP echo requests (ping) to monitor IP addresses. It allows for concurrent pinging of multiple hosts, providing response times and identifying unreachable hosts. The current version is 1.1.2. Releases are infrequent but address compatibility and bug fixes, indicating a stable, low-maintenance project.
pip install multipingVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize `MultiPing` with a list of hosts, send ICMP echo requests, and then receive responses within a specified timeout. It handles common `PermissionError` that arises from sending raw ICMP packets.
Run your Python script with `sudo python your_script.py` on Linux/macOS, or as an administrator on Windows. Alternatively, consider using `setcap` on Linux to grant CAP_NET_RAW capability to your Python executable if appropriate for your security model.
Choose an appropriate timeout value for `mp.receive(timeout_seconds)` based on your network conditions and requirements. A typical starting point is 0.5 to 1.0 seconds for general internet hosts.
For critical applications or a large number of hosts, pre-resolve hostnames to IP addresses using `socket.gethostbyname()` or similar functions before passing them to `MultiPing`. Handle DNS resolution errors explicitly if required.
Run the script with elevated privileges: `sudo python your_script.py` on Linux/macOS, or as an administrator on Windows. Ensure no firewall is blocking outbound ICMP traffic.
Run the script with elevated privileges: `sudo python your_script.py` on Linux/macOS, or as an administrator on Windows. Check firewall rules.
Install the library using pip: `pip install multiping`. If using a virtual environment, ensure it is activated before installation and execution.
No dependency data recorded yet.