Tuesday 18 January 2022

Linux: Monitor Directory Free/Used space

 #!/bin/bash

unset PERLBIN

unset PERL5LIB

output=$(df -H | grep '/home/oracle/naf' | awk '{ print $5 " " $1 }' )

echo $output

usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1  )

echo $usep

if [ $usep -ge 10 ]; then


sendEmail -f DB.Notification@xx.com -s 10.100.75.123 -t mohammed.almasri@xx.com  -u "NAF directory low space" -m "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)"   -o tls=no

fi


Number of Visitors