Files
cronmaster/app/_utils/snippets/check-memory.sh
2025-08-18 13:50:17 +01:00

14 lines
413 B
Bash

# @id: check-memory
# @title: Check memory usage
# @description: Alert if memory usage is high
# @category: System Operations
# @tags: memory,monitor,alert
# Check memory usage
# Alert if memory usage is above 90%
MEMORY_USAGE=$(free | grep Mem | awk '{printf("%.0f", $3/$2 * 100.0)}')
if [ $MEMORY_USAGE -gt 90 ]; then
echo "Memory usage is ${MEMORY_USAGE}%" | mail -s "Memory Alert" admin@example.com
fi