sms alert if the direktory is full on server linux
20.42
membuat alarm meggunakan SMS untuk mengetahui direktori dalam server yang USAGE,
#!/bin/bash
cd /oracle
df -h | egrep '/oracle|/app' | awk '{ print $5 " " $6 }' | while read output;
do
echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
mount=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge 90 ]; then
/usr/bin/java -classpath . Broadcast "Running out of space \"$mount ($usep)percent \" on $(hostname) as
on $(date)"
fi
done
software yang dibutuhkan adalah server sudah terinnsatal java
ada 3 elemen file yang harus tersedian untuk sistem ini yaitu, : sat.lst (yang berisi nomor" yang akan menerima alert) Broadcast.class (untuk membroadcast sms tersebut), chek.sh (yang berisi coding di atas)
0 komentar