Monday, October 3, 2022
Bash Script

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

(Visited 87 times, 2 visits today)
Klik untuk berbagi dengan orang lain
Baca Juga :  Backup dari Debian/Ubuntu/Centos/Open BSD ke Synology

Similar Posts


Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270

Warning: Trying to access array offset on value of type bool in /home/des1gn/hendro-wibiksono.web.id/wp-content/plugins/floating-related-posts/floating-related-posts-pro.php on line 270