Commit 66788d1b authored by Robert Ricci's avatar Robert Ricci
Browse files

Add scripts to run the magent, analogous to the scripts to run the

old version of the stub.
parent 7b9e8681
......@@ -78,6 +78,7 @@ export PROJECT=`echo $NICKNAME | cut -d. -f3`;
SCRIPT_LOCATION=`dirname $0`
export BASE="${SCRIPT_LOCATION}/../";
export STUB_DIR="${BASE}/stub/";
export MAGENT_DIR="${BASE}/magent/";
export NETMON_DIR="${BASE}/libnetmon/";
export MONITOR_DIR="${BASE}/monitor/";
export TMPDIR="/var/tmp/";
......@@ -93,6 +94,7 @@ export IPMAP="/var/tmp/ip-mapping.txt"
#
export NETMOND="netmond"
export STUBD="stubd"
export MAGENT="magent"
export MONITOR="monitor.py"
export GENIPMAP="gen-ip-mapping.pl"
export NETMON_LIB="libnetmon.so"
......
#!/bin/sh
ARGS=$*
. `dirname $0`/../common-env.sh
#
# Start up our own measurement agent
#
echo $SH ${MAGENT_DIR}/run-magent.sh $ARGS
$SH ${MAGENT_DIR}/run-magent.sh $ARGS &
MAGENTPID=$!
# Kill the agent if we get killed - TODO: harsher kill?
trap "$AS_ROOT kill $MAGENTPID; $AS_ROOT killall $MAGENT" EXIT
#
# Give it time to come up
#
sleep 1
#
# Wait for all of the agents to start
#
echo "Waiting for measurement agents to become ready";
barrier_wait "stub";
#
# Wait for all the monitors to come up
#
echo "Waiting for monitors to become ready";
barrier_wait "monitor";
echo "Running!";
#
# Wait for our agent to finish
#
wait
#!/bin/sh
#
# Script to run the monitoring agent
#
#
# Let common-env know what role we're playing
#
export HOST_ROLE="stub"
#
# Grab common environment variables
#
. `dirname $0`/../common-env.sh
#
# Have libnetmon export to a seperate file
#
export LIBNETMON_OUTPUTFILE="/local/logs/libnetmon.out"
#
# Just run the stub!
#
echo "Running PID $$"
echo "Starting magent on $PLAB_IFACE ($PLAB_IP) Extra arguments: $*"
exec $AS_ROOT $NETMON_DIR/instrument-standalone.sh $MAGENT_DIR/$MAGENT --interface=$PLAB_IFACE $*
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment