run-monitor-libnetmon.sh 736 Bytes
Newer Older
1
#!/bin/sh
2 3 4
#
# Script to run the monitor, collecting data from libnetmon
#
5

6 7 8 9 10
#
# Let common-env know what role we're playing
#
export HOST_ROLE="monitor"

11 12 13 14 15
#
# Grab common environment variables
#
. `dirname $0`/../common-env.sh

16 17 18
if [ $# != 0 ]; then
    if [ $# != 1 ]; then
      echo "Usage: $0 [stub-ip]"
19 20
      exit 1;
    fi
21
    SIP=$1
22 23
fi

24 25 26
if ! [ -x "$NETMON_DIR/$NETMOND" ]; then
    gmake -C $NETMON_DIR $NETMOND
fi
27

28 29
if ! [ -x "$NETMON_DIR/$NETMOND" ]; then
    echo "$NETMON_DIR/$NETMOND missing - run 'gmake' in $NETMOND_DIR to build it"
30 31
    exit 1;
fi
32

33 34
echo "Starting up netmond for $PROJECT/$EXPERIMENT $PELAB_IP $SIP";
exec $NETMON_DIR/$NETMOND | $PYTHON $MONITOR_DIR/$MONITOR ip-mapping.txt $PROJECT/$EXPERIMENT $PELAB_IP $SIP