#!/usr/bin/env bash # usage usage() { USAGE=$(cat </tmp/top_proccesses_consuming_memory.txt file=/tmp/top_proccesses_consuming_memory.txt echo -e "Memory on $HOSTNAME is running low ($MEMORY_USAGE_ALERT_THRESHOLD MB is the remaining threshold)!\n\nFree memory: $free MB" | mailx -a "$file" -s "$SUBJECT" "$MEMORY_USAGE_ALERT_MAIL_ADDRESS" fi exit 0