Hands-on task
Alert with hysteresis
Write a script /root/alert.sh that takes a number (a metric) as an argument and prints ALERT or OK with hysteresis: the alarm turns on when the value is ≥ 80 and stays on until the value drops to ≤ 60 (between 60 and 80 the state does not change). Persist the state between runs in the file /root/.alert_state.
- hysteresis
- bash script
- state in a file
- thresholds
- conditional branching