--- projects/cms/source/host/generic/statgrab.pl 2001/01/22 17:23:25 1.11 +++ projects/cms/source/host/generic/statgrab.pl 2001/01/22 17:29:28 1.12 @@ -3,7 +3,7 @@ #----------------------------------------------------------------- # Machine statistics grabber # $Author: pjm2 $ -# $Id: statgrab.pl,v 1.11 2001/01/22 17:23:25 pjm2 Exp $ +# $Id: statgrab.pl,v 1.12 2001/01/22 17:29:28 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.11 $'; + print 'version statgrab.pl $Revision: 1.12 $'; print "\n"; } @@ -150,12 +150,15 @@ sub include_top() { $top =~ /([^\s]+?)([MG]) swap in use/; my($swap_in_use) = $1; $swap_in_use*=1024 if $2 eq "G"; - &print_pair(1, "packet.memory.swap_in_use", $swap_in_use); + # DO NOT print this one out... save it for in a moment... $top =~ /([^\s]+?)([MG]) swap free/; my($swap_free) = $1; $swap_free*=1024 if $2 eq "G"; &print_pair(1, "packet.memory.swap_free", $swap_free); + + # AJ requested total swap instead of swap_in_use, so here we go! + &print_pair(1, "packet.memory.swap_total", $swap_free + $swap_in_use); } # sub to get details of the machine's operating system.