Skip to content

Instantly share code, notes, and snippets.

@anakuron
Last active October 9, 2023 16:47
Show Gist options
  • Save anakuron/4db38a0bd63d77e6414896d06b92e5e5 to your computer and use it in GitHub Desktop.
Save anakuron/4db38a0bd63d77e6414896d06b92e5e5 to your computer and use it in GitHub Desktop.
pushover memory alert
#!/bin/bash
free=$(free -mt | grep Mem | awk '{print $4}')
if [[ "$free" -le 100 ]]; then
ntfy -b pushover -o user_key YOURKEY send 'memory is less than 100MB'
fi
exit 0
#run every hour as root
# put it to /etc/crontab
#0 * * * * root /opt/scripts/free-watchdog.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment