Skip to content
Snippets Groups Projects
Commit c80d9550 authored by Jan David Mol's avatar Jan David Mol
Browse files

Configure host to allow ELK stack to run, if needed

parent 4ac3ed09
No related branches found
No related tags found
1 merge request!7Resolve #2021 "03 16 branched from master elk stack"
......@@ -3,11 +3,19 @@
# See https://elk-docker.readthedocs.io/
#
# Defines:
# - elk-configure-host: Configures the hosts's kernel to be able to use the ELK stack
# - elk: ELK stack
#
version: '2'
services:
elk-configure-host:
image: elk-configure-host
build:
context: elk-configure-host
container_name: ${CONTAINER_NAME_PREFIX}elk-configure-host
network_mode: ${NETWORK_MODE}
elk:
image: sebp/elk
container_name: ${CONTAINER_NAME_PREFIX}elk
......@@ -16,3 +24,5 @@ services:
- "5601:5601"
- "9200:9200"
- "5044:5044"
depends_on:
- elk-configure-host
......@@ -2,3 +2,6 @@ FROM nexus.engageska-portugal.pt/ska-docker/tango-itango:latest
COPY lofar-requirements.txt /lofar-requirements.txt
RUN pip3 install -r /lofar-requirements.txt
ENV TANGO_LOG_PATH=/var/log/tango
RUN sudo mkdir -p /var/log/tango && sudo chmod a+rwx /var/log/tango
%% Cell type:code id:social-massachusetts tags:
``` python
def force_start(device):
if device.state() == DevState.FAULT:
device.Off()
if device.state() == DevState.OFF:
device.initialise()
if device.state() == DevState.INIT:
device.Standby()
if device.state() == DevState.STANDBY:
device.On()
return device.state()
```
%% Cell type:code id:defined-apache tags:
``` python
sdp = DeviceProxy("SDP/LTS/1")
sdp.force_start()
for d in devices:
print("Device %s is now in state %s" % (d, force_start(d)))
```
%% Output
%% Cell type:code id:superior-wheel tags:
Device PCC(lts/pcc/1) is now in state FAULT
Device SDP(lts/sdp/1) is now in state ON
``` python
devices
```
%% Cell type:code id:superior-wheel tags:
%% Cell type:code id:fifteen-transportation tags:
``` python
```
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment