Health Daemon Overview
Overview
The purpose of this daemon is to monitor the health of all of the other services and translate them into signals via 3 physical LED lights. There are 3 lights this will control:
- Temp:
- Off - No power, completely disconnected
- Red - Daemon reporting an error
- Orange, Solid - Daemon reporting a warning
- Orange, slow blinking - No temp sensors connected
- Orange, rapid blinking - Some temp sensors connected
- Green - Temp daemon reporting temps across all sensors
- Control:
- Off - No power, completely disconnected
- Red - Daemon reporting an error
- Orange - Daemon reporting a warning
- Green - Control daemon working properly
- Web:
- Off - No power, completely disconnected
- Red - Daemon reporting an error
- Warning - Daemon reporting a warning
- Green - Web interface up and working properly
Health for each service should be monitored in the following ways:
- Temp - Read Redis health state and subscribe to temp events
- if there are no temp events within the last 10 seconds, set LED to red
- if there is an error reported, set LED to red
- if there is a warning reported, set LED to orange
- use the sensor-connected logic above in the case that any sensors are not listed
- otherwise, set LED to green
- Control - Read control health status from redis. Health should indicate:
- Healthy - Green LED
- Warning reported - Orange LED
- Error reported - Red LED
- Any health status timestamp older than 10 seconds - Orange LED
- Any health status timestamp older than 1 minute - Red LED
- Web
- Http request to API health endpoint every 5 seconds
- Healthy - Green LED
- Warning reported - Orange LED
- Error reported - Red LED
- Http request to index every 5 seconds
- On 2xx status - Green LED
- On error status - Red LED
- on response lasting longer than 1 second - Orange LED
- Http request to API health endpoint every 5 seconds