Oups, previous patch missed /sbin hard path for ifconfig, thus it failed as non root user.
Regards, Olivier. Le mercredi 23 décembre 2009 14:02:43 Olivier LAHAYE, vous avez écrit : > > Hi, > > Here is a patch against trunk regarding the test_user script for ganglia. > > basically (on my system at least), gstat --all report displays infos about > the head using the hostname associated to ip of the private interface (oscar > network interface). > This name is therefore different from hostname -f or hostname -s used in the > test_user script > thus the test fails as the hostname list of systems reported by ganglia > differs from list computed by the script (using hostname -f) (the head names > don't match) > > This patch will modify the way we compute the list of hostnames (the name of > oscar head). > > I'm not sure that this is the way to go, but IMHO it makes sens that the name > used from head is the one corresponding to the nework used by nodes. > > Technically, this patch does the following: > - takes the iface name of private network from oscar.conf file > - gets this ip of this iface from ifconfig > - grep it from /etc/hosts file > - takes the 1st hostname > > I've also replaced > .....`perl -e "print join('|',split(/ +/,\"$*\"))"` > by > IFS="|" ..... $* > which is more simple and more easy to read. > > What worries me is that the gmetad.conf contains the head public fqdn > hostname.... > > -- Olivier LAHAYE CEA Saclay DRT-LIST-DETECS-SSTM
Index: test_user =================================================================== --- test_user (révision 9168) +++ test_user (copie de travail) @@ -37,7 +37,12 @@ numhosts=`expr $clients + 1` # use gstat to determine number of hosts ganglia has detected -pattern=`hostname -f`"|"`perl -e "print join('|',split(/ +/,\"$*\"))"` +#pattern=`hostname -f`"|"`perl -e "print join('|',split(/ +/,\"$*\"))"` +oscar_nic_conf=($(grep OSCAR_NETWORK_INTERFACE /etc/oscar/oscar.conf)) +head_private_ip=$(LC_ALL=C /sbin/ifconfig ${oscar_nic_conf[2]}|grep -o -E '([[:digit:]]+\.)+[[:digit:]]+'|head -1) +private_hostnames=($(grep "$head_private_ip" /etc/hosts)) +IFS="|" pattern="${private_hostnames[1]}|$*" +#pattern="${hostnames[1]}|"`perl -e "print join('|',split(/ +/,\"$*\"))"` # simple test which counts the number of detected nodes (via gstat) with # the number of expected nodes (from argument)
------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________ Oscar-devel mailing list Oscar-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oscar-devel