{"library":"multiping","title":"MultiPing Library","description":"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.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install multiping"],"cli":null},"imports":["from multiping import MultiPing"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"from multiping import MultiPing\nimport time\n\n# List of hosts to ping\nhosts = ['127.0.0.1', 'google.com', 'nonexistent.domain', '8.8.8.8']\n\ntry:\n    # Create a MultiPing instance with a list of hosts\n    # Optionally specify a port (defaults to 1 for ICMP) and IPv6 (False by default)\n    mp = MultiPing(hosts, timeout=1, retry=1, verbose=False)\n\n    # Send the ICMP echo requests\n    # This sends packets in a non-blocking way\n    mp.send()\n\n    # Wait for responses for up to 1 second\n    # receive() returns responses, and a list of hosts that did not respond within the timeout\n    responses, no_responses = mp.receive(1.0)\n\n    print(\"--- Ping Results ---\")\n    for addr, rtt in responses.items():\n        print(f\"Host: {addr}, RTT: {rtt*1000:.2f} ms\")\n\n    if no_responses:\n        print(\"\\n--- No Response From ---\")\n        for addr in no_responses:\n            print(f\"Host: {addr}\")\n\nexcept PermissionError:\n    print(\"Error: Permission denied. Running ping often requires root/administrator privileges.\")\n    print(\"Try running with 'sudo python your_script.py' or as an administrator on Windows.\")\nexcept Exception as e:\n    print(f\"An unexpected error occurred: {e}\")","lang":"python","description":"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.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}