membuat script auto restart DNS

#!/bin/bash nslookup google.com localhost > /dev/null if [ $? -eq 1 ] then /etc/init.d/pdns stop echo $(date) >> /tmp/monitor.log fi ket : lookup google ke localhost $? artinya jika benar hasilnya 0 , jika gagal hasilnya 1 -eq 1 artinya jika hasilnya 1 ( gagal ) maka service DNS akan di restart echo $(date) artinya … Read more

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 … Read more

How to Clear RAM Memory Cache, Buffer and Swap Space on Linux

Every Linux System has three options to clear cache without interrupting any processes or services. 1. Clear PageCache only. # sync; echo 1 > /proc/sys/vm/drop_caches 2. Clear dentries and inodes. # sync; echo 2 > /proc/sys/vm/drop_caches 3. Clear PageCache, dentries and inodes. # sync; echo 3 > /proc/sys/vm/drop_caches If you want to clear Swap space, … Read more