DashMachine
DashMachine copied to clipboard
Ping not working...
Hi,
I can't use ping features :/
[auth_ping] platform = ping resource = 192.168.1.1
And i have this errors :
Mar 23 16:58:16 Traefik dashmachine[1454491]: Traceback (most recent call last):
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/app.py", line 2463, in __call__
Mar 23 16:58:16 Traefik dashmachine[1454491]: return self.wsgi_app(environ, start_response)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/app.py", line 2449, in wsgi_app
Mar 23 16:58:16 Traefik dashmachine[1454491]: response = self.handle_exception(e)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
Mar 23 16:58:16 Traefik dashmachine[1454491]: return original_handler(e)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/app.py", line 1866, in handle_exception
Mar 23 16:58:16 Traefik dashmachine[1454491]: reraise(exc_type, exc_value, tb)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
Mar 23 16:58:16 Traefik dashmachine[1454491]: raise value
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/app.py", line 2446, in wsgi_app
Mar 23 16:58:16 Traefik dashmachine[1454491]: response = self.full_dispatch_request()
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/app.py", line 1951, in full_dispatch_request
Mar 23 16:58:16 Traefik dashmachine[1454491]: rv = self.handle_user_exception(e)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask_restful/__init__.py", line 272, in error_router
Mar 23 16:58:16 Traefik dashmachine[1454491]: return original_handler(e)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/app.py", line 1820, in handle_user_exception
Mar 23 16:58:16 Traefik dashmachine[1454491]: reraise(exc_type, exc_value, tb)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/_compat.py", line 39, in reraise
Mar 23 16:58:16 Traefik dashmachine[1454491]: raise value
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/app.py", line 1949, in full_dispatch_request
Mar 23 16:58:16 Traefik dashmachine[1454491]: rv = self.dispatch_request()
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/lib/python3.7/site-packages/flask/app.py", line 1935, in dispatch_request
Mar 23 16:58:16 Traefik dashmachine[1454491]: return self.view_functions[rule.endpoint](**req.view_args)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/dashmachine/main/routes.py", line 84, in load_data_source
Mar 23 16:58:16 Traefik dashmachine[1454491]: data = get_data_source(data_source)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/dashmachine/main/utils.py", line 104, in get_data_source
Mar 23 16:58:16 Traefik dashmachine[1454491]: return platform.process()
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/opt/dashmachine/dashmachine/platform/ping.py", line 34, in process
Mar 23 16:58:16 Traefik dashmachine[1454491]: up = subprocess.call(command) == 0
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/usr/lib/python3.7/subprocess.py", line 323, in call
Mar 23 16:58:16 Traefik dashmachine[1454491]: with Popen(*popenargs, **kwargs) as p:
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/usr/lib/python3.7/subprocess.py", line 775, in __init__
Mar 23 16:58:16 Traefik dashmachine[1454491]: restore_signals, start_new_session)
Mar 23 16:58:16 Traefik dashmachine[1454491]: File "/usr/lib/python3.7/subprocess.py", line 1522, in _execute_child
Mar 23 16:58:16 Traefik dashmachine[1454491]: raise child_exception_type(errno_num, err_msg, err_filename)
Mar 23 16:58:16 Traefik dashmachine[1454491]: FileNotFoundError: [Errno 2] No such file or directory: 'ping': 'ping'
I try to change in platform/ping.py
- command = ["ping", param, "1", self.resource]
+ command = ["/bin/ping", param, "1", self.resource]
but i have this error now :
Mar 23 17:10:14 Traefik dashmachine[1454491]: ping: socket: Operation not permitted
work with OS lib :
import os
up = os.system("/bin/ping -c 1 " + self.resource)
if up == 0 :
icon_class = "theme-success-text"
else:
icon_class = "theme-failure-text"