1
1
scripts/monitoring/free.sh
david c19aa59021 < ‘check_for_ubuntu_release.sh’
> ‘monitoring/check_for_ubuntu_release.sh’
< ‘diskmon.lst.sample’
> ‘monitoring/diskmon.lst.sample’
< ‘diskmon.sh’
> ‘monitoring/diskmon.sh’
< ‘free.sh’
> ‘monitoring/free.sh’
< ‘get_uptime.sh’
> ‘monitoring/get_uptime.sh’
< ‘heartbeat.sh’
> ‘monitoring/heartbeat.sh’
2012-10-05 19:56:59 +02:00

15 lines
425 B
Bash

#!/bin/bash
freememory=$(free -m | grep "cache:" | awk '{print $4}')
threshold="300"
if [ $freememory -gt $threshold ]; then
echo "There is $freememory MB availible. Threshold not reached."
else
echo "There is less than $threshold MB of memory availible."
/home/david/mail.sh "There is less than $threshold MB of memory availible!! You should probably do something about that pretty soon brother!!"
fi
exit 0