--- projects/cms/source/host/generic/statgrab.pl 2001/02/05 19:59:35 1.30 +++ projects/cms/source/host/generic/statgrab.pl 2001/02/05 20:27:59 1.31 @@ -3,7 +3,7 @@ #----------------------------------------------------------------- # Machine statistics grabber # $Author: tdb $ -# $Id: statgrab.pl,v 1.30 2001/02/05 19:59:35 tdb Exp $ +# $Id: statgrab.pl,v 1.31 2001/02/05 20:27:59 tdb Exp $ # # A Perl script to return various information about a host machine # by examining the output of some common Unix/Linux commands. @@ -29,7 +29,7 @@ my($topbin); my($dfbin); my($usersbin); my($unamebin); if ($ostype eq "SunOS") { # covers: Solaris 8 - $topbin = "/usr/local/sbin/top"; + $topbin = "/usr/local/sbin/top -d2 -s1 0"; $dfbin = "/usr/bin/df"; $usersbin = "/usr/ucb/users"; $unamebin = "/usr/bin/uname"; @@ -37,7 +37,7 @@ if ($ostype eq "SunOS") { } elsif ($ostype eq "Linux") { # covers: Debian r2.2 - $topbin = "/usr/bin/top"; + $topbin = "/usr/bin/top -d1 -n0 -b"; $dfbin = "/bin/df"; $usersbin = "/usr/bin/users"; $unamebin = "/bin/uname"; @@ -45,7 +45,7 @@ elsif ($ostype eq "Linux") { } elsif ($ostype eq "FreeBSD") { # covers: FreeBSD 4.2-STABLE - $topbin = "/usr/bin/top"; + $topbin = "/usr/bin/top -d2 -s1 0"; $dfbin = "/bin/df"; $usersbin = "/usr/bin/users"; $unamebin = "/usr/bin/uname"; @@ -76,7 +76,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.30 $'; + print 'version statgrab.pl $Revision: 1.31 $'; print "\n"; } @@ -146,7 +146,7 @@ sub include_users() { sub include_top() { # Find out some numbers from top. - my(@top) = `$topbin -d2 -s1 0`; + my(@top) = `$topbin`; my($top) = join(" ", @top); $top =~ s/\n//g;