How do I convert this perl regexp to include all file systems?

tc0nn

New member
Okay geniuses, help me out here... Basically I have a script monitoring my file systems for utilization over X percent. Right now, I think it only monitor "/" and not any other filesystem. How do I convert the following script to also monitor (for example) /mnt/nas or /home?
---- code ---
open(DF, $df . '|') or die "Can't read from Disk Free command '$df': $!\n";
my ($buf, $add);
while (<DF>) {
$buf .= $_;
if ( /.*\s.*\s.*\s.*\s(.*)%\s\/$/ ) {
if ( $1 >= $maxdiskutil ) {
$add++;
}
}
}#while
close(DF);
--- /code ---
Output from the df command (example):

#>df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 124G 34G 83G 30% /
/dev/sda2 2.0G 36M 1.9G 2% /tmp
tmpfs 2.0G 0 2.0G 0% /dev/shm


Keep in mind, I still want to specify which filesystems. For example, I want to list all the important filesystems and ignore the other ones like /tmp.
 
You'll have to show us the output of your df command in order for us to help you...

But perhaps if you just delete the $ from the regexp it will do what you want...
 
Back
Top