Write swap-checker.sh script that checks whether it is not the exhaustion of RAM, or is ready to use swap space in a defined, pre-defined periodic intervals. You can use the free command (for tests./free.pl). In the event that begins to fulfill the swap space, send mail to root@locahost. Check its operation through mutt.
To simulate the exhaustion of RAM we are for you programmed script free.pl. In the script you can use it instead of the command free.
Program the lock to a flood of email. When the RAM is full, send mail only once. You can send another email when the RAM is emptied, and the RAM is filled again.
For solving the problem follow these steps:
We prepared for you video course Marian's BASH Video Training: Mastering Unix Shell, if you would like to get much more information.
Thank you. Marian Knezek