--- projects/cms/source/host/generic/statgrab.pl 2001/01/22 23:21:34 1.13 +++ projects/cms/source/host/generic/statgrab.pl 2001/01/28 19:53:39 1.15 @@ -2,8 +2,8 @@ #----------------------------------------------------------------- # Machine statistics grabber -# $Author: tdb $ -# $Id: statgrab.pl,v 1.13 2001/01/22 23:21:34 tdb Exp $ +# $Author: pjm2 $ +# $Id: statgrab.pl,v 1.15 2001/01/28 19:53:39 pjm2 Exp $ # # A Perl script to return various information about a host machine # by examining the output of some common Unix/Linux commands. @@ -48,7 +48,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.13 $'; + print 'version statgrab.pl $Revision: 1.15 $'; print "\n"; } @@ -107,9 +107,10 @@ sub include_users() { # Find out all users on this machine. my($users) = `$usersbin`; - my(@users) = split(/\s+/, $users); - - my($users_count) = $#users + 1; + chop($users); + $users = "" unless defined $users; + my($users_count) = 0; + $users_count++ while $users =~ /\w+/g; my($users_list) = $users; &print_pair(1, "packet.users.count", $users_count);