Site icon Learning & Doing

Script to alert Memory (RAM)

script nya :

bikin file ram.sh

#!/bin/bash

[ `free -m | grep Mem | awk ‘{print $3}’` -ge 14000 ] && free -m | grep Mem | awk ‘{print “RAM usage: “$3” of “$2}’ | mail -S smtp=175.176.161.163 -r admin@localhost.com -s “memory report” yuby@yubyml.com

ket : jadi jika RAM used sudah sampai 14 GB maka akan ada alert email ke yuby@yubyml.com

 

bikin cron nya

* * * * * /home/ram.sh

Exit mobile version