Subroutine for checkdiskspace()
Subroutine for checkdiskspace()
- Notice the call of the message function
- Flexible to handle messages from either check function
- Just add the additional check of additional filesystems with the appropriate floor value (minimum disk free space available)
sub checkdiskspace{
local ($fs,$blocksavail)=@_; $check="disk space";
if( $fs eq "/") {
&message ($blocksavail, $fs, "disk space", $tot_blocks)
if ($blocksavail < 10000);
}
if( $fs eq "/usr") {
&message ($blocksavail, $fs, "disk space", $tot_blocks)
if ($blocksavail < 12000);
}
}