blob: 9620b8739103d82088b509839b4a994d2ae26119 [file] [log] [blame]
Till Westmann7ce7c4b2014-11-10 06:34:23 -08001#!/usr/bin/env bash
Till Westmannea8ab392013-06-05 15:17:08 -07002#/*
3# Copyright 2009-2013 by The Regents of the University of California
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# you may obtain a copy of the License from
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15#*/
ramangrover29116eb972013-02-20 20:47:35 +000016INSTANCE_NAME=$1
17MASTER_NODE=$2
18shift 2
19numargs=$#
20for ((i=1 ; i <= numargs ; i=i+2))
21do
22 host=$1
23 nc_id=$2
24 INFO=$(ssh $host "ps -ef | grep nc_join | grep -v grep | grep -v ssh| grep $nc_id" | head -n 1 )
25 PARENT_ID=`echo $INFO | cut -d " " -f2`
ramangrover29@gmail.com4ba21522013-02-27 23:35:42 +000026 PID_INFO=$(ssh $host "ps -ef | grep asterix | grep -v grep | grep -v nc_join | grep $PARENT_ID")
ramangrover29116eb972013-02-20 20:47:35 +000027 PID=`echo $PID_INFO | cut -d " " -f2`
28 echo "NC:$host:$nc_id:$PID"
29 shift 2
30done
31
ramangrover29@gmail.com4ba21522013-02-27 23:35:42 +000032CC_PARENT_ID_INFO=$(ssh $MASTER_NODE "ps -ef | grep asterix | grep cc_start | grep -v ssh")
ramangrover29116eb972013-02-20 20:47:35 +000033CC_PARENT_ID=`echo $CC_PARENT_ID_INFO | tr -s " " | cut -d " " -f2`
ramangrover29@gmail.com4ba21522013-02-27 23:35:42 +000034CC_ID_INFO=$(ssh $MASTER_NODE "ps -ef | grep asterix | grep $CC_PARENT_ID | grep -v bash")
ramangrover29116eb972013-02-20 20:47:35 +000035CC_ID=`echo $CC_ID_INFO | tr -s " " | cut -d " " -f2`
36echo "CC:$MASTER_NODE:N/A:$CC_ID"