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.
---- 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.