All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

Commit 23660690 authored by Robert Ricci's avatar Robert Ricci

Change run-monitor-libnetmon.sh to run netmond, instead of the

application directly.

Add a new script, instrument.sh, that runs your app with libnetmon,
which will connect to netmond, and thus to the monitor.

Change both to allow them to be run from arbitrary directories - you
no longer have to cd into the monitor directory to run them.
parent 21da5416
#!/bin/sh
SCRIPT=`which $0`
SCRIPT_LOCATION=`dirname $SCRIPT`
LIB_LOCATION=$SCRIPT_LOCATION/../libnetmon/
LIB_SO=libnetmon.so
SOCK=/var/tmp/netmon.sock
if ! [ -x $LIB_LOCATION/$LIB_SO ]; then
echo "$LIB_LOCATION/$LIB_SO missing - run 'gmake' in $LIB_LOCATION to build it"
exit 1;
fi
export LD_LIBRARY_PATH=$LIB_LOCATION
export LD_PRELOAD=$LIB_SO
export LIBNETMON_SOCKPATH=$SOCK
echo "Instrumenting '$@' with libnetmon"
$@
#!/bin/sh
LIB_LOCATION=../libnetmon/
LIB_SO=libnetmon.so
if ! [ -x $LIB_LOCATION/$LIB_SO ]; then
echo "$LIB_LOCATION/$LIB_SO missing - run 'gmake' in $LIB_LOCATION to build it"
if [ $# != 2 ]; then
echo "Usage: $0 pid eid"
exit 1;
fi
export LD_LIBRARY_PATH=$LIB_LOCATION
export LD_PRELOAD=$LIB_SO
PID=$1
EID=$2
SCRIPT=`which $0`
SCRIPT_LOCATION=`dirname $SCRIPT`
BIN_LOCATION=$SCRIPT_LOCATION/../libnetmon/
BIN=netmond
PID=shift
EID=shift
if ! [ -x $BIN_LOCATION/$BIN ]; then
echo "$BIN_LOCATION/$BIN missing - run 'gmake' in $BIN_LOCATION to build it"
exit 1;
fi
echo "$0 running $@";
$@ | python monitor.py ip-mapping.txt $PID $EID
echo "Starting up netmond for $PID $EID";
$BIN_LOCATION/$BIN | python monitor.py ip-mapping.txt $PID $EID
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