LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Script to alert about mount point space via sendmail to user. (https://www.linuxquestions.org/questions/linux-newbie-8/script-to-alert-about-mount-point-space-via-sendmail-to-user-796419/)

pradeep2002gs 03-19-2010 01:08 AM

Script to alert about mount point space via sendmail to user.
 
Hi all
i'm in search of Script that sends a mail to the user if the mount point goes beyond 80% of its full space.
send mail is configured in the system so that it can communicate with mail server.
if any have idea pls guide me.
thanks in advance.
Happy day:study:

troop 03-19-2010 01:31 AM

Code:

#!/bin/sh
use=`df -h|grep mount_point|awk '{print $5}'|tr -d '%'`
max_use=80
if [ $use -gt $max_use ]; then
    mail -s 'disk is full' 'some@where.com'
fi

Although, I would recommend monit.


All times are GMT -5. The time now is 01:36 AM.