2
0
mirror of https://github.com/munin-monitoring/contrib.git synced 2018-11-08 00:59:34 +01:00

Enhanced used memory calculation for values displayed in G

This commit is contained in:
Andreas Geesen 2014-02-21 12:33:05 +01:00
parent 5e2aaa3a67
commit 6a12882b4a

View File

@ -88,7 +88,7 @@ for ( $i = 1; ($i < $#top and $quit == 0); $i++ ) {
$active =~ s/^.+?, (\d+)M active.+$/$1/; chomp $active; $active = $active * 1024 * 1024;
$inactive =~ s/^.+?, (\d+)M inactive.+$/$1/; chomp $inactive; $inactive = $inactive * 1024 * 1024;
$free =~ s/^.+?, (\d+)([M|K]) free.+$/$1/; chomp $free; $free = $free * 1024 * 1024; if ( $2 eq "K" ) { $free = $free / 1024; }
$used =~ s/^.+?, (\d+)M used.+$/$1/; chomp $used; $used = $used * 1024 * 1024;
$used =~ s/^.+?, (\d+)([M|G]) used.+$/$1/; chomp $used; $used = $used * 1024 * 1024; if ( $2 eq "G" ) { $used = $used * 1024; }
print "wired.value " . $wired . "\n";
print "active.value " . $active . "\n";
print "inactive.value " . $inactive . "\n";