--- projects/cms/source/host/generic/statgrab.pl 2001/01/22 17:17:48 1.10 +++ projects/cms/source/host/generic/statgrab.pl 2001/01/22 17:23:25 1.11 @@ -3,7 +3,7 @@ #----------------------------------------------------------------- # Machine statistics grabber # $Author: pjm2 $ -# $Id: statgrab.pl,v 1.10 2001/01/22 17:17:48 pjm2 Exp $ +# $Id: statgrab.pl,v 1.11 2001/01/22 17:23:25 pjm2 Exp $ # # A Perl script to return various information about a host machine # by examining the output of some common Unix/Linux commands. @@ -42,7 +42,7 @@ exit(0); # the host should check this when reading data # means the host must be checked and updated to work with newer versions. sub print_ident() { - print 'version statgrab.pl $Revision: 1.10 $'; + print 'version statgrab.pl $Revision: 1.11 $'; print "\n"; } @@ -138,19 +138,23 @@ sub include_top() { # If they are preceeded by a G, then multiply by 1024. $top =~ /([^\s]+?)([MG]) real/; - my($real) = $1*1024 if $2 eq "G"; + my($real) = $1; + $real*=1024 if $2 eq "G"; &print_pair(1, "packet.memory.real", $real); $top =~ /([^\s]+?)([MG]) free/; - my($free) = $1*1024 if $2 eq "G"; + my($free) = $1; + $free*=1024 if $2 eq "G"; &print_pair(1, "packet.memory.free", $free); $top =~ /([^\s]+?)([MG]) swap in use/; - my($swap_in_use) = $1*1024 if $2 eq "G"; + my($swap_in_use) = $1; + $swap_in_use*=1024 if $2 eq "G"; &print_pair(1, "packet.memory.swap_in_use", $swap_in_use); $top =~ /([^\s]+?)([MG]) swap free/; - my($swap_free) = $1*1024 if $2 eq "G"; + my($swap_free) = $1; + $swap_free*=1024 if $2 eq "G"; &print_pair(1, "packet.memory.swap_free", $swap_free); }