Skip to content

Instantly share code, notes, and snippets.

@kylekyle
Last active January 23, 2016 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylekyle/9117d48224b0f4a82d23 to your computer and use it in GitHub Desktop.
Save kylekyle/9117d48224b0f4a82d23 to your computer and use it in GitHub Desktop.
Return a health monitoring status
''' Add to jupyter_notebook_config.py
import sys
sys.path.append("/root/.jupyter/extensions/")
c.NotebookApp.reraise_server_extension_failures = True
c.NotebookApp.server_extensions = ['status']
'''
from notebook.utils import url_path_join
from notebook.base.handlers import IPythonHandler
class Status(IPythonHandler):
def get(self):
self.finish("I'm alive and well, thank you very much.")
def load_jupyter_server_extension(app):
web_app = app.web_app
host_pattern = '.*$'
route_pattern = url_path_join(web_app.settings['base_url'], '/v1/status')
web_app.add_handlers(host_pattern, [(route_pattern, Status)])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment