From efcca0b2b0719f5ac4858b3999f3b238249c032f Mon Sep 17 00:00:00 2001 From: Michael Howe Date: Thu, 27 Dec 2018 10:36:59 +0000 Subject: [PATCH] Fix scaling error Values returned by AFS tools are in K, but munin assumes they're in bytes. Multiplying up by 1024 fixes that. --- plugins/afs_volumes_partition_ | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/afs_volumes_partition_ b/plugins/afs_volumes_partition_ index 5ae1333..79fd9f5 100755 --- a/plugins/afs_volumes_partition_ +++ b/plugins/afs_volumes_partition_ @@ -50,8 +50,8 @@ sub partinfo { while( my $line = <$pinfo> ){ # Free space on partition /vicepa: 1595716 K blocks out of total 4767360 if( $line =~ m{/vicep[a-z]+:\s+(\d+) K.*total\s+(\d+)\s*$} ){ - $results{free} = $1; - $results{total} = $2; + $results{free} = $1 * 1024; + $results{total} = $2 * 1024; $results{used} = $results{total} - $results{free}; } } @@ -74,14 +74,14 @@ sub serverinfo { my( $volume, $size, %results ); while( my $line = <$lvol> ){ if ($line =~ /^(\S+)\s+\d+ RW\s+(\d+) K\s+On-line\s*$/) { - ($volume, $size) = ($1, $2); + ($volume, $size) = ($1, $2 * 1024); my $orig_vol_name = $volume; $volume =~ s{\.}{_}g; $results{v}{$volume}{size} = $size; $results{v}{$volume}{name} = $orig_vol_name; $results{t}{size} += $size; } elsif ($line =~ /^\s+MaxQuota\s+(\d+) K\s*$/ && defined $volume) { - $results{v}{$volume}{quota} = $1; + $results{v}{$volume}{quota} = $1 * 1024; $results{v}{$volume}{percent} = sprintf "%.2f", ( $results{v}{$volume}{size} / $results{v}{$volume}{quota} * 100 ); $results{t}{quota} += $1; $volume = undef; -- 2.39.5