Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
ad7dcb64
Commit
ad7dcb64
authored
Dec 07, 2006
by
Robert Ricci
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix so that this script should work correctly if any of the planet-*
nodes have been removed from the topology.
parent
d1397979
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
4 deletions
+15
-4
pelab/monitor/gen-ip-mapping.pl
pelab/monitor/gen-ip-mapping.pl
+15
-4
No files found.
pelab/monitor/gen-ip-mapping.pl
View file @
ad7dcb64
...
...
@@ -15,7 +15,7 @@ my %opt;
getopts
('
p
',
\
%opt
);
use
strict
;
my
(
%elabips
,
%plabips
);
my
(
%elabips
,
%plabips
,
%planetnodes
);
open
(
HOSTS
,"
/etc/hosts
")
or
die
"
Unable to open /etc/hosts: $!
\n
";
...
...
@@ -26,6 +26,10 @@ while (<HOSTS>) {
$elabips
{
$
1
}
=
$IP
;
}
elsif
(
$firstname
=~
/^(.+)-(plink|plan|pcloud|plabc)$/
)
{
$plabips
{
$
1
}
=
$IP
;
}
elsif
(
$firstname
=~
/^(.+)-realinternet$/
)
{
# Note - we don't really get the planetlab node's IP address in the
# hosts file, so we just use this to find out if the node exists at all
$planetnodes
{
$
1
}
=
1
;
}
}
...
...
@@ -47,11 +51,18 @@ foreach my $elabnode (keys %elabips) {
print
"
$elabips
{
$elabnode
}
$plabips
{
$planetnode
} elabc-
$elabnode
\n
";
$lines_output
++
;
}
else
{
# If there is not a corresponding planet-* node in the hosts file, it
# has probably been removed from the experiment, and we should skip ip
my
$plabnode
=
$elabnode
;
$plabnode
=~
s/^elab/planet/
;
if
(
!
exists
(
$planetnodes
{
$plabnode
})){
warn
"
Skipping
$plabnode
, which doesn't exist
\n
";
next
;
}
# 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/
;
# common-env.sh so that these enviroment variables are set
my
$plabhostname
=
"
$plabnode
.
$ENV
{EXPERIMENT}.
$ENV
{PROJECT}.emulab.net
";
# 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?
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment