#!/bin/bash

##################################
#  @program        smon
#  @description    simulation monitor
#  @copyright      Copyright “(c)2009 Centre National de la Recherche Scientifique CNRS. 
#                             All Rights Reserved”
#  @svn_file       $Id: failover 2545 2013-02-01 09:58:10Z jripsl $
#  @version        $Rev: 2545 $
#  @lastrevision   $Date: 2013-02-01 10:58:10 +0100 (Fri, 01 Feb 2013) $
#  @license        CeCILL (http://dods.ipsl.jussieu.fr/jripsl/smon/LICENSE)
##################################

stack_file=$1
send_msg="/home/jripsl/snapshot/Monitoring/CNClient/sendAMQPMsg"

if [ $# -lt 1 ]; then
	echo "Usage $0 ../sample/stack_light"
	exit 1
fi

IFS=$'\n'
for line in $(cat $stack_file); do
	#echo $line | awk -F" " '{print $4}'
	callname=$(echo $line | awk -F" " '{print $4}' )
	$send_msg localhost 5672 string "$callname"
done
