diff --git a/jupyter-notebooks/Home.ipynb b/jupyter-notebooks/Home.ipynb index fdc993d374fe9b757580af20d3750de065bc010f..1b6001f9e5a87a0d626e310cc8038ede2d5f589f 100644 --- a/jupyter-notebooks/Home.ipynb +++ b/jupyter-notebooks/Home.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "markdown", - "id": "d3ffb821", + "id": "e051e48d", "metadata": {}, "source": [ "# Welcome to your LOFAR2.0 station!\n", @@ -16,12 +16,12 @@ "|Logs |Kibana |5601| |\n", "|ReST |tango-rest|8080|tango-cs/tango|\n", "\n", - "Below are codes to manage the station at high level." + "Below are codes to manage the station at high level. For more detailed status information, look in Grafana." ] }, { "cell_type": "markdown", - "id": "70a5de26", + "id": "32ae8bcf", "metadata": {}, "source": [ "## (Re)boot station\n", @@ -32,8 +32,8 @@ }, { "cell_type": "code", - "execution_count": 16, - "id": "57263a16", + "execution_count": null, + "id": "38037a71", "metadata": {}, "outputs": [], "source": [ @@ -50,8 +50,8 @@ }, { "cell_type": "code", - "execution_count": 17, - "id": "64f33a76", + "execution_count": null, + "id": "21aba361", "metadata": {}, "outputs": [], "source": [ @@ -65,7 +65,7 @@ { "cell_type": "code", "execution_count": null, - "id": "714b7f0b", + "id": "c00b465a", "metadata": {}, "outputs": [], "source": [ @@ -81,10 +81,62 @@ " print(f\"Failed to initialise station: {boot.initialisation_status_R}\")" ] }, + { + "cell_type": "markdown", + "id": "b444b751", + "metadata": {}, + "source": [ + "## Inspect Docker status\n", + "Docker containers that are not running will not provide any functionality, and are ignored when the station is rebooted." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "8b09f9da", + "metadata": {}, + "outputs": [], + "source": [ + "container_status = {attr_name: getattr(docker, attr_name)\n", + " for attr_name in docker.get_attribute_list()\n", + " if attr_name.endswith(\"_R\")\n", + " and attr_name != 'version_R'}\n", + "\n", + "not_running_containers = [container for container, running in container_status.items() if running is False]\n", + "\n", + "if not not_running_containers:\n", + " print(\"All docker containers are running\")\n", + "else:\n", + " print(f\"Docker containers that are NOT running: {not_running_containers}\")" + ] + }, + { + "cell_type": "markdown", + "id": "55f3981d", + "metadata": {}, + "source": [ + "## Inspect Device status\n", + "Check whether all software devices are indeed up and running." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "637e6e22", + "metadata": {}, + "outputs": [], + "source": [ + "for d in devices:\n", + " try:\n", + " print(f\"Device {d.dev_name()} is in state {d.state()}\")\n", + " except ConnectionFailed as e:\n", + " print(f\"Device {d.dev_name()} is in state DOWN: {e.args[0].desc}\")" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "299b0ceb", + "id": "23008885", "metadata": {}, "outputs": [], "source": []