HEX
Server: nginx/1.29.3
System: Linux 11979.bigscoots-wpo.com 6.8.0-88-generic #89-Ubuntu SMP PREEMPT_DYNAMIC Sat Oct 11 01:02:46 UTC 2025 x86_64
User: nginx (1068)
PHP: 7.4.33
Disabled: exec,system,passthru,shell_exec,proc_open,proc_close,popen,show_source,cmd# Do not modify this line # 1684243876
Upload Files
File: //proc/1284357/root/bigscoots/mon_disk.sh
#!/bin/sh


log="/var/tmp/du.log"

df -h > /tmp/du$$

while read line
do
    fields=`echo $line | awk '{print NF}'`
    case $fields in
    5) echo $line | awk '{print $5,$4}' >> $log;;
    6) echo $line | awk '{print $6,$5}' >> $log;;
    esac
done < /tmp/du$$

cat "/var/tmp/du.log" | while read -r output;
do
  usep=$(echo "$output" | awk '{ print $2}' | cut -d'%' -f1  )
  partition=$(echo "$output" | awk '{ print $1 }' )
  if [ "$usep" -ge 90 ]; then
    (
        echo "Hello,"
        echo "Your server is currently using ($usep%) of its available disk space."
        echo "Please try and free up space or see about upgrading to the next package to increase your available disk space."
        echo "You can also reply back to this email to open a support ticket to request assistance."
        echo ""
        echo "Regards"
        echo "The Bigscoots Team"
        echo ""
        echo ""
        echo "Automated Response $(date)"

     ) | mail -s "BigScoots Alert: Almost out of disk space $usep% -  $(hostname)" -S replyto="[email protected]" [email protected]
  fi
done

rm /tmp/du$$ /var/tmp/du.log