Warn if inodes are running now

This commit is contained in:
Jamie Cameron
2018-02-10 22:54:15 -08:00
parent 2c5a15da20
commit 6578ee258e
3 changed files with 27 additions and 1 deletions

View File

@@ -359,7 +359,7 @@ foreach my $m (@mounted) {
($t, $f) = @$zp;
}
else {
($t, $f) = &mount::disk_space($m->[2], $m->[0]);
($t, $f) = &disk_space($m->[2], $m->[0]);
}
if (($m->[2] eq "simfs" || $m->[2] eq "vzfs" ||
$m->[0] eq "/dev/vzfs" ||
@@ -370,8 +370,14 @@ foreach my $m (@mounted) {
}
$total += $t*1024;
$free += $f*1024;
my ($it, $if);
if (defined(&inode_space)) {
($it, $if) = &inode_space($m->[2], $m->[0]);
}
push(@fs, { 'total' => $t*1024,
'free' => $f*1024,
'itotal' => $it,
'ifree' => $if,
'dir' => $m->[0],
'device' => $m->[1],
'type' => $m->[2] });

View File

@@ -24,6 +24,8 @@ 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_ifsfull=Warning! The filesystem mounted at $1 has no free inodes out of $2!
right_ifsnearly=Warning! The filesystem mounted at $1 has only $3 of free inodes out of $2
right_quota=Disk usage and quota
right_header5=Account Information
right_uquota=Disk quota and usage

View File

@@ -223,6 +223,24 @@ if ($info->{'disk_fs'} && &show_section('disk')) {
'level' => 'warn',
'warning' => $msg });
}
next if (!$fs->{'itotal'});
if ($fs->{'ifree'} == 0) {
my $msg = &text('right_ifsfull',
"<tt>$fs->{'dir'}</tt>",
$fs->{'itotal'});
push(@rv, { 'type' => 'warning',
'level' => 'danger',
'warning' => $msg });
}
elsif ($fs->{'free'}*1.0 / $fs->{'total'} < 0.01) {
my $msg = &text('right_ifsnearly',
"<tt>$fs->{'dir'}</tt>",
$fs->{'itotal'},
$fs->{'ifree'});
push(@rv, { 'type' => 'warning',
'level' => 'warn',
'warning' => $msg });
}
}
}