Commit 63a206c4 authored by Mike Hibler's avatar Mike Hibler

Add dbmonitor, a varient of the monitor that ignores the stubs entirely

and just updates link characteristics based on the pelab DB values.
parent 02f6a090
......@@ -111,14 +111,22 @@ set clientprog "/usr/bin/iperf -t 60 -c "
#
set use_magent 0
#
# If non-zero, uses the DB-based "monitor" to control the cloud shaping
#
set use_dbmonitor 0
# End of user-settable options
##########
#
# -DNODE has fixes but is not as heavily tested
#
#set delay_os FBSD54-FUTURE
# XXX should really never use -FUTURE anymore.
set delay_os FBSD54-DNODE
#set delay_os FBSD54-FUTURE
# XXX -UPDATE for now. Contains bug fixes (progagent command lines).
set node_os PLAB-DEVBOX-UPDATE
#set node_os PLAB-DEVBOX
tb-set-delay-os $delay_os
......@@ -139,6 +147,11 @@ if {$use_magent} {
} else {
set stubcommand "/bin/sh /local/pelab/stub/auto-stub.sh"
}
if {$use_dbmonitor} {
set moncommand "/bin/sh /local/pelab/dbmonitor/auto-dbmonitor.sh"
} else {
set moncommand "/bin/sh /local/pelab/monitor/auto-monitor.sh"
}
set elan_string ""
set plan_string ""
......@@ -186,7 +199,7 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
if {$fake_plab} {
set plab($i) [$ns node]
tb-set-node-os $plab($i) PLAB-DEVBOX
tb-set-node-os $plab($i) $node_os
tb-set-hardware $plab($i) $hwtype
append plan_string "$plab(${i}) "
set plabstub($i) [$plab($i) program-agent -command $stubcommand]
......@@ -207,10 +220,10 @@ for {set i 1} {$i <= $num_pcs} {incr i} {
}
set elab($i) [$ns node]
tb-set-node-os $elab($i) PLAB-DEVBOX
tb-set-node-os $elab($i) $node_os
tb-set-hardware $elab($i) $hwtype
append elan_string "$elab(${i}) "
set monitor($i) [$elab($i) program-agent -command "/bin/sh /local/pelab/monitor/auto-monitor.sh"]
set monitor($i) [$elab($i) program-agent -command $moncommand]
lappend monitorlist $monitor($i)
set server($i) [$elab($i) program-agent -command $serverprog]
......
......@@ -84,6 +84,7 @@ export STUB_DIR="${BASE}/stub/";
export MAGENT_DIR="${BASE}/magent/";
export NETMON_DIR="${BASE}/libnetmon/";
export MONITOR_DIR="${BASE}/monitor/";
export DBMONITOR_DIR="${BASE}/dbmonitor/";
export TMPDIR="/var/tmp/";
export LOGDIR="/local/logs/"
......@@ -99,6 +100,7 @@ export NETMOND="netmond"
export STUBD="stubd"
export MAGENT="magent"
export MONITOR="monitor.py"
export DBMONITOR="dbmonitor.pl"
export GENIPMAP="gen-ip-mapping.pl"
export NETMON_LIB="libnetmon.so"
......
#!/bin/sh
ARGS=$*
if [ -z "$PID" -o -z "$EID" ]; then
echo "*** experiment PID and EID are not set!"
exit 1
fi
. `dirname $0`/../common-env.sh
#
# We don't give a rat's ass about the stubs, but we have to stay in synch
#
echo "Waiting for stubs to become ready";
barrier_wait "stub"; _rval=$?
if [ $_rval -ne 0 ]; then
echo "*** WARNING: not all stubs started ($_rval)"
fi
#
# Copy over the node list
#
cp -p /proj/$PID/exp/$EID/tmp/node_list /var/tmp/node-mapping
#
# Start up our own monitor
#
echo $SH ${DBMONITOR_DIR}/run-dbmonitor.sh $ARGS
$SH ${DBMONITOR_DIR}/run-dbmonitor.sh $ARGS &
DBMONPID=$!
# Kill the monitor if we get killed - TODO: harsher kill?
trap "$AS_ROOT kill $DBMONPID" EXIT
#
# Give it time to come up
#
sleep 1
#
# Wait for all the monitors to come up
#
echo "Waiting for dbmonitors to become ready";
barrier_wait "monitor"; _rval=$?
if [ $_rval -ne 0 ]; then
echo "*** WARNING: not all dbmonitors started ($_rval)"
fi
echo "Running!";
#
# Wait for our monitor to finish
#
wait
This diff is collapsed.
#!/bin/sh
#
# Script to run the monitor, collecting data from libnetmon
#
#
# Let common-env know what role we're playing
#
export HOST_ROLE="monitor"
#
# Grab common environment variables
#
. `dirname $0`/../common-env.sh
#
# Just run it!
#
echo "Running PID $$"
echo "Starting dbmonitor, Extra arguments: $*"
exec $AS_ROOT $DBMONITOR_DIR/$DBMONITOR $* $PID $EID
......@@ -8,6 +8,7 @@ my $LOGHOLE = "/usr/testbed/bin/loghole";
my $PYTHON = "/usr/local/bin/python";
my $PERL = "/usr/bin/perl";
my $EVENTSYS = "/usr/testbed/bin/eventsys_control";
my $NODELIST = "/usr/testbed/bin/node_list";
my $realplab = 0;
my $initelab = 0;
......@@ -15,7 +16,7 @@ my $initelab = 0;
my $UNKNOWN = "<unknown>";
my $stub_cmd = "/bin/sh /local/pelab/magent/auto-magent.sh";
my $stub_cmdargs = $UNKNOWN;
my $mon_cmd = "/bin/sh /local/pelab/monitor/auto-monitor.sh";
my $mon_cmd = "/bin/sh /local/pelab/dbmonitor/auto-dbmonitor.sh";
my $mon_cmdargs = $UNKNOWN;
sub get_cmdargs($$);
......@@ -155,6 +156,15 @@ if (system "$PYTHON resetlinks.py $pid $eid") {
die "Error resetting links\n";
}
#
# XXX stash node list for experiment since nodes don't have node_list
# right now. This is needed by the dbmonitor if it is in use.
#
print "##### Stashing node list for experiment\n";
if (system "$NODELIST -m -e $pid,$eid > /proj/$pid/exp/$eid/tmp/node_list") {
warn "Could not create node list for dbmonitor; it will fail if used\n";
}
#
# Restart the event system so the 'create' event, necessary for pelab to work,
# gets fired again
......@@ -205,7 +215,7 @@ my $startarg = "";
print "##### Starting stubs";
if ($stub_cmdargs ne $UNKNOWN) {
print " with: '$stub_cmd $stub_cmdargs'";
$startarg = "'COMMAND={$stub_cmd $stub_cmdargs}'";
$startarg = "'COMMAND=$stub_cmd $stub_cmdargs'";
}
print "\n";
if ($realplab) {
......@@ -222,7 +232,7 @@ $startarg = "";
print "##### Starting monitors\n";
if ($mon_cmdargs ne $UNKNOWN) {
print " with: '$mon_cmd $mon_cmdargs'";
$startarg = "'COMMAND={$mon_cmd $mon_cmdargs}'";
$startarg = "'COMMAND=$mon_cmd $mon_cmdargs'";
}
print "\n";
if (system "$TEVC -e $pid/$eid now monitorgroup start $startarg") {
......
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