blob: 28977aa2b2d0fc9aa71b8e269238afc03c71a628 [file] [log] [blame]
Till Westmannea8ab392013-06-05 15:17:08 -07001#/*
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#*/
ramangrover29116eb972013-02-20 20:47:35 +000015INSTANCE_NAME=$1
16MASTER_NODE=$2
17shift 2
18numargs=$#
19for ((i=1 ; i <= numargs ; i=i+2))
20do
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.com4ba21522013-02-27 23:35:42 +000025 PID_INFO=$(ssh $host "ps -ef | grep asterix | grep -v grep | grep -v nc_join | grep $PARENT_ID")
ramangrover29116eb972013-02-20 20:47:35 +000026 PID=`echo $PID_INFO | cut -d " " -f2`
27 echo "NC:$host:$nc_id:$PID"
28 shift 2
29done
30
ramangrover29@gmail.com4ba21522013-02-27 23:35:42 +000031CC_PARENT_ID_INFO=$(ssh $MASTER_NODE "ps -ef | grep asterix | grep cc_start | grep -v ssh")
ramangrover29116eb972013-02-20 20:47:35 +000032CC_PARENT_ID=`echo $CC_PARENT_ID_INFO | tr -s " " | cut -d " " -f2`
ramangrover29@gmail.com4ba21522013-02-27 23:35:42 +000033CC_ID_INFO=$(ssh $MASTER_NODE "ps -ef | grep asterix | grep $CC_PARENT_ID | grep -v bash")
ramangrover29116eb972013-02-20 20:47:35 +000034CC_ID=`echo $CC_ID_INFO | tr -s " " | cut -d " " -f2`
35echo "CC:$MASTER_NODE:N/A:$CC_ID"