is there a script in linux to notify that the hard disk space is 95% full.

Posted on 2006-04-13
Last Modified: 2013-12-16
is there a script in linux to notify that the hard disk space is 95% full.

or has any one written or used something that could let you know when the hard disk space is getting full.

Question by:muthiahmerchant
    LVL 7

    Accepted Solution

    We've written perl scripts to do this:

    open(DC,'df -P --type ext3| awk \'{print $5" "$6}\' |')
            || die "Unable to check diskspace";

    # then just scan
    while(<DC>) {
      if ($1 > $highwatermark) {
              $alert .= "Overfull alert: $1% $2\n";
    to loop through the drives and check that the percentages don't exceed our high watermark.

    if any do, send me an email and page me.

    LVL 1

    Author Comment

    Thanks, will try it and get back to you.
    LVL 7

    Expert Comment

    don't forget to set $highwatermark = 95;

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    rdate is a Linux command and the network time protocol for immediate date and time setup from another machine. The clocks are synchronized by entering rdate with the -s switch (command without switch just checks the time but does not set anything). …
    Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
    Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
    Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now