Till Westmann | ea8ab39 | 2013-06-05 15:17:08 -0700 | [diff] [blame] | 1 | #/* |
| 2 | # Copyright 2009-2013 by The Regents of the University of California |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # you may obtain a copy of the License from |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | #*/ |
ramangrover29 | 116eb97 | 2013-02-20 20:47:35 +0000 | [diff] [blame] | 15 | INSTANCE_NAME=$1 |
| 16 | MASTER_NODE=$2 |
| 17 | shift 2 |
| 18 | numargs=$# |
| 19 | for ((i=1 ; i <= numargs ; i=i+2)) |
| 20 | do |
| 21 | host=$1 |
| 22 | nc_id=$2 |
| 23 | INFO=$(ssh $host "ps -ef | grep nc_join | grep -v grep | grep -v ssh| grep $nc_id" | head -n 1 ) |
| 24 | PARENT_ID=`echo $INFO | cut -d " " -f2` |
ramangrover29@gmail.com | 4ba2152 | 2013-02-27 23:35:42 +0000 | [diff] [blame] | 25 | 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] | 26 | PID=`echo $PID_INFO | cut -d " " -f2` |
| 27 | echo "NC:$host:$nc_id:$PID" |
| 28 | shift 2 |
| 29 | done |
| 30 | |
ramangrover29@gmail.com | 4ba2152 | 2013-02-27 23:35:42 +0000 | [diff] [blame] | 31 | 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] | 32 | 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] | 33 | 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] | 34 | CC_ID=`echo $CC_ID_INFO | tr -s " " | cut -d " " -f2` |
| 35 | echo "CC:$MASTER_NODE:N/A:$CC_ID" |