romana / multi-ping

Python library to monitor one or many IP addresses via ICMP echo (ping) requests

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

MultiPingSocketError while django testing app development on local server

siddeshpawar opened this issue · comments

After manage.py runserver getting the following error.
I have created a data model from where I am fetching the value of the switch_ip in the view function and then calling the script named as ping.py with the function named as job. And in ping.py I am using multiping. But facing the below error.

10.255.42.123
hello
Internal Server Error: /network_monitoring
Traceback (most recent call last):
File "C:\Users\sidde\AppData\Local\Programs\Python\Python38\lib\site-packages\multiping_init_.py", line 104, in init
addr_info = socket.getaddrinfo(d, None)
File "C:\Users\sidde\AppData\Local\Programs\Python\Python38\lib\socket.py", line 834, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 11001] getaddrinfo failed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\sidde\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\exception.py", line 34, in inner
response = get_response(request)
File "C:\Users\sidde\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\base.py", line 115, in _get_response
response = self.process_exception_by_middleware(e, request)
File "C:\Users\sidde\AppData\Local\Programs\Python\Python38\lib\site-packages\django\core\handlers\base.py", line 113, in get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "C:\Users\sidde\PycharmProjects\ether_discovery_project\ether_discovery_project\ether_discovery\views.py", line 50, in network_monitoring
a=ping.job(switch_ip_a2)
File "C:\Users\sidde\PycharmProjects\ether_discovery_project\ether_discovery_project\python_scripts\ping.py", line 18, in job
mp = MultiPing(IP)
File "C:\Users\sidde\AppData\Local\Programs\Python\Python38\lib\site-packages\multiping_init
.py", line 135, in init
raise MultiPingSocketError("Cannot lookup '%s'" % d)
multiping.MultiPingSocketError: Cannot lookup '1'
[04/May/2020 17:09:14] "GET /network_monitoring HTTP/1.1" 500 88939