vinayakb | 5ee049d | 2013-04-06 21:21:29 +0000 | [diff] [blame^] | 1 | INSTANCE_NAME=$1 |
| 2 | MASTER_NODE=$2 |
| 3 | shift 2 |
| 4 | numargs=$# |
| 5 | for ((i=1 ; i <= numargs ; i=i+2)) |
| 6 | do |
| 7 | host=$1 |
| 8 | nc_id=$2 |
| 9 | INFO=$(ssh $host "ps -ef | grep nc_join | grep -v grep | grep -v ssh| grep $nc_id" | head -n 1 ) |
| 10 | PARENT_ID=`echo $INFO | cut -d " " -f2` |
| 11 | PID_INFO=$(ssh $host "ps -ef | grep asterix | grep -v grep | grep -v nc_join | grep $PARENT_ID") |
| 12 | PID=`echo $PID_INFO | cut -d " " -f2` |
| 13 | echo "NC:$host:$nc_id:$PID" |
| 14 | shift 2 |
| 15 | done |
| 16 | |
| 17 | CC_PARENT_ID_INFO=$(ssh $MASTER_NODE "ps -ef | grep asterix | grep cc_start | grep -v ssh") |
| 18 | CC_PARENT_ID=`echo $CC_PARENT_ID_INFO | tr -s " " | cut -d " " -f2` |
| 19 | CC_ID_INFO=$(ssh $MASTER_NODE "ps -ef | grep asterix | grep $CC_PARENT_ID | grep -v bash") |
| 20 | CC_ID=`echo $CC_ID_INFO | tr -s " " | cut -d " " -f2` |
| 21 | echo "CC:$MASTER_NODE:N/A:$CC_ID" |