ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +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` |
ramangrover29@gmail.com | 4ba2152 | 2013-02-27 23:35:42 +0000 | [diff] [blame^] | 11 | PID_INFO=$(ssh $host "ps -ef | grep asterix | grep -v grep | grep -v nc_join | grep $PARENT_ID") |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 12 | PID=`echo $PID_INFO | cut -d " " -f2` |
| 13 | echo "NC:$host:$nc_id:$PID" |
| 14 | shift 2 |
| 15 | done |
| 16 | |
ramangrover29@gmail.com | 4ba2152 | 2013-02-27 23:35:42 +0000 | [diff] [blame^] | 17 | CC_PARENT_ID_INFO=$(ssh $MASTER_NODE "ps -ef | grep asterix | grep cc_start | grep -v ssh") |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 18 | CC_PARENT_ID=`echo $CC_PARENT_ID_INFO | tr -s " " | cut -d " " -f2` |
ramangrover29@gmail.com | 4ba2152 | 2013-02-27 23:35:42 +0000 | [diff] [blame^] | 19 | CC_ID_INFO=$(ssh $MASTER_NODE "ps -ef | grep asterix | grep $CC_PARENT_ID | grep -v bash") |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 20 | CC_ID=`echo $CC_ID_INFO | tr -s " " | cut -d " " -f2` |
| 21 | echo "CC:$MASTER_NODE:N/A:$CC_ID" |