diff --git a/plinth/modules/diagnostics/__init__.py b/plinth/modules/diagnostics/__init__.py index 866a9e57c..8005882b3 100644 --- a/plinth/modules/diagnostics/__init__.py +++ b/plinth/modules/diagnostics/__init__.py @@ -21,7 +21,19 @@ Plinth module for system diagnostics from . import diagnostics from .diagnostics import init +from plinth import action_utils __all__ = ['diagnostics', 'init'] depends = ['plinth.modules.system'] + + +def diagnose(): + """Run diagnostics and return the results.""" + results = [] + results.append(action_utils.diagnose_port_listening(8000, 'tcp4')) + results.append(action_utils.diagnose_port_listening(8000, 'tcp6')) + results.extend(action_utils.diagnose_url_on_all( + 'http://{host}/plinth/', extra_options=['--no-check-certificate'])) + + return results diff --git a/plinth/modules/diagnostics/urls.py b/plinth/modules/diagnostics/urls.py index afb7025e5..741538c7c 100644 --- a/plinth/modules/diagnostics/urls.py +++ b/plinth/modules/diagnostics/urls.py @@ -25,7 +25,6 @@ from django.conf.urls import patterns, url urlpatterns = patterns( # pylint: disable-msg=C0103 'plinth.modules.diagnostics.diagnostics', url(r'^sys/diagnostics/$', 'index', name='index'), - url(r'^sys/diagnostics/test/$', 'test', name='test'), - url(r'^sys/diagnostics/module/(?P[a-z\-]+)/$', 'module', + url(r'^sys/diagnostics/(?P[a-z\-]+)/$', 'module', name='module'), )