umbrel
umbrel copied to clipboard
Feature Request: When memory-monitor detects high memory usage, call ./scripts/memory-usage and save result
My node crashed (froze and refused to accept connections), and after restart I saw a memory-warning but didn't know which app/container caused it.
It could be nice to add after this line something like:
if [ ! -f "${UMBREL_ROOT}/statuses/memory-warning-logged" ]; then
date > "${UMBREL_ROOT}/logs/high-memory-usage-report.log"
"${UMBREL_ROOT}/scripts/memory-usage" >> "${UMBREL_ROOT}/logs/high-memory-usage-report.log"
touch "${UMBREL_ROOT}/statuses/memory-warning-logged"
fi
And after this line:
if (( $percent_memory_used < 70 )); then
rm "${UMBREL_ROOT}/statuses/memory-warning-logged"
fi
This will save the last memory-usage, but also call the memory-usage script only once (until the memory usage falls below 70%, and then goes again above 90%)