+ Reply to Thread
Results 1 to 5 of 5

Thread: Filesystems GT 95%

  1. #1
    tedientang
    Guest

    Filesystems GT 95%

    20.000 Softwares download here
    Hi

    How can I only print the file systems that are more than 95% full.

    I used the df -k output and tried to check for each file system and then print only the ones that meet the criteria... But my solution seems cloodgie ...

  2. #2
    satthudien2003
    Guest

    Hey, put your scripts up so that we can see if there is any better solution.

  3. #3
    saytinhkiemphap
    Guest

    df -k |awk '($2-$3)/$2*100 > 95 {print $0}'



    You can print $1(file-system) or $7(mounted directory) instead of $0



    Good Luck

  4. #4
    thanhnhat2
    Guest

    I had to search, but I had written this Perl script for automatic notification if the filesystem was greater than some arbirtary percentage:




    Code:

    #!/usr/bin/perl

    # auswipe, 5 Apr 2002
    # Tested under OpenBSD 2.9
    # auswipe sez : "No guarantees!"

    $upperLimit = 80; # Upper Limit in % for a File System
    $mailTarget = "joe\@blow.com"; # Target for the automatic e-mail message

    open(STATS, "df -h\|grep '%'|") || die "$!";

    my @fileStats = ;

    foreach $entryLine (@fileStats) {
    chomp($entryLine);
    $entryLine =~ s/\s / /g;
    my @fsStats = split(/ /, $entryLine);
    $fsStats[4] =~ s/%//g;
    if ($fsStats[4] >= $upperLimit) {
    open(MAIL, "|mail -s \"FileSystem $fsStats[0] Getting Full!\" $mailTarget ") || die "Can't open m
    ail!";
    select(MAIL);
    print << "EOF";

    The FileSystem $fsStats[0] is getting full.
    Currently, the file system is ${fsStats[4]}% full. The upper
    limit has been placed at ${upperLimit}%.

    Please attend to this matter.

    -auswipe

    This message has been created automatically. Please do not respond to this message.
    EOF
    close(MAIL);

    };
    };
    close(STATS);


+ Reply to Thread

Similar Threads

  1. Filesystems Part Deux
    By jupiter3932 in forum SUN Solaris
    Replies: 2
    Last Post: 02-16-2005, 01:46 AM
  2. Vdump of two filesystems
    By nguyenhoai1983 in forum Peripherals / Hardware
    Replies: 5
    Last Post: 08-17-2002, 01:27 AM
  3. filesystems resizing
    By Ling709 in forum Linux Advanced
    Replies: 7
    Last Post: 01-31-2002, 04:15 PM
  4. The /proc Filesystems
    By vangvo in forum Linux Advanced
    Replies: 2
    Last Post: 01-13-2002, 05:04 PM
  5. Filesystems
    By chunghero in forum Linux Advanced
    Replies: 7
    Last Post: 09-03-2001, 10:27 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts