Disk Space

Hi Guys

i have a nice little piece of code then i need to modify so that is does not look at /Voulmes/*

thanks

sub disk_full {
    my $i = 0;
    open( DF, "df -l|" );
    while (<DF>) {
        #chomp();
        next if (/^\/proc\b/);
        $i++;
        next if ( $i == 1 );

        my ( $Filesystem, $blocks, $Used, $Available, $Use_perc, $Mounted ) =
          split( " ", $_ );
        next if (/\/dev*$/);
        next if (/\/dev\/shm$/);
                next if (/\/Volumes\/*$/i);
        #next if (/\/.automont\/hosts\/*$/);
        $Use_perc =~ s/\%//g;
        if ( $Use_perc > 90 ) {
                        my $msg = $Mounted . " is " . $Use_perc . "% full ; ";
            push(@errors, $msg);
        }
    }
    close(DF); 

any ideas - as you can see i have tired but it does not work?

thanks
Adam

Place the next if statement before the split.

so do you mean it should look like this

sub disk_full {
    my $i = 0;
    open( DF, "df -l|" );
    while (<DF>) {
        #chomp();
        next if (/^\/proc\b/);
        $i++;
        next if ( $i == 1 );
        next if (/\/dev*$/);
        next if (/\/dev\/shm$/);
        next if (/\/Volumes\/*$/i);
        next if (/\/.automont\/hosts\/*$/);

        my ( $Filesystem, $blocks, $Used, $Available, $Use_perc, $Mounted ) =
          split( " ", $_ );
               $Use_perc =~ s/\%//g;
        if ( $Use_perc > 90 ) {
                        my $msg = $Mounted . " is " . $Use_perc . "% full ; ";
            push(@errors, $msg);
        }
    }
    close(DF);

You are right.