Commit 80abdccd authored by Robert Ricci's avatar Robert Ricci

Modify to work when half of the experiment is running on the real

planetlab, not inside Emulab.

Note, you shouldn't run this by hand, let run-monitor-libnetmon.sh run
it - it wants to have the EXPERIMENT and PROJECT env variables set.
parent b35b39a2
......@@ -26,6 +26,24 @@ foreach my $elabnode (keys %elabips) {
if (exists $plabips{$plabnode}) {
print "$elabips{$elabnode} $plabips{$plabnode} elabc-$elabnode\n";
$lines_output++;
} else {
# Let's hope this is an experiment with a real (not emulated) planetlab
# half. Note - this should be run by something that has sourced
# common-env.sh so that these are set
my $plabhostname = "$elabnode.$ENV{EXPERIMENT}.$ENV{PROJECT}.emulab.net";
$plabhostname =~ s/^elab/planet/;
# Find out the IP address for $plabhostname
open(H,"host $plabhostname |") or die "Unable to run host\n";
# Yuck. Why can't 'host' have a flag to spit out just the IP?
<H>; # Throw away first line
# The next line is the one with interesting data
my $interesting_line = <H>;
close H;
if ($interesting_line =~ /has address (.*)$/) {
my $plabIP = $1;
print "$elabips{$elabnode} $plabIP elabc-$elabnode\n";
$lines_output++;
}
}
}
......
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