diff --git a/system-status/lang/en b/system-status/lang/en index 1b2520482..744c48b9d 100644 --- a/system-status/lang/en +++ b/system-status/lang/en @@ -22,6 +22,8 @@ right_disk=Local disk space right_used=$2 used, $1 total right_used2=$2 used, $1 guaranteed, $3 burstable right_out=$1 of $2 +right_fsfull=Warning! The $2 filesystem mounted at $1 has no free disk space! +right_fsnearly=Warning! The $2 filesystem mounted at $1 has only $3 of free disk space right_quota=Disk usage and quota right_header5=Account Information right_uquota=Disk quota and usage diff --git a/system-status/system-status-lib.pl b/system-status/system-status-lib.pl index 04e16c83f..c80225ba2 100755 --- a/system-status/system-status-lib.pl +++ b/system-status/system-status-lib.pl @@ -54,7 +54,7 @@ if (&foreign_check("proc")) { # Disk space on local filesystems if (&foreign_check("mount")) { &foreign_require("mount"); - ($info->{'disk_total'}, $info->{'disk_free'}) = + ($info->{'disk_total'}, $info->{'disk_free'}, $info->{'disk_fs'}) = &mount::local_disk_space(); } diff --git a/system-status/system_info.pl b/system-status/system_info.pl index bfd1ef0e2..011f5e915 100644 --- a/system-status/system_info.pl +++ b/system-status/system_info.pl @@ -202,6 +202,29 @@ if ($info->{'disk_total'} && &show_section('disk')) { 'chart' => [ $total, $total-$free ] }); } +# Warnings about filesytems running now on space +if ($info->{'disk_fs'} && &show_section('disk')) { + foreach my $fs (@{$info->{'disk_fs'}}) { + if ($fs->{'total'} && $fs->{'free'} == 0) { + my $msg = &text('right_fsfull', + "$fs->{'dir'}", + &nice_size($fs->{'total'})); + push(@rv, { 'type' => 'warning', + 'level' => 'error', + 'warning' => $msg }); + } + elsif ($fs->{'free'}*1.0 / $fs->{'total'} < 0.01) { + my $msg = &text('right_fsnearly', + "$fs->{'dir'}", + &nice_size($fs->{'total'}), + &nice_size($fs->{'free'})); + push(@rv, { 'type' => 'warning', + 'level' => 'warn', + 'warning' => $msg }); + } + } + } + # Package updates if ($info->{'poss'} && &show_section('poss')) { my @poss = @{$info->{'poss'}};