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
a8cda915
Commit
a8cda915
authored
Sep 26, 2006
by
Leigh B. Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a routine to return the current up/down status of nodes in an experiment.
parent
c0fc3d6e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
db/Experiment.pm.in
db/Experiment.pm.in
+31
-0
No files found.
db/Experiment.pm.in
View file @
a8cda915
...
...
@@ -1352,5 +1352,36 @@ sub WriteProgramAgents($)
return
0
;
}
#
#
Return
node
status
list
for
all
nodes
in
the
experiment
.
Status
is
defined
#
as
either
up
or
down
,
which
for
now
is
going
to
be
returned
as
0
,
1.
#
sub
NodeStatusList
($$)
{
my
($
self
,
$
prval
)
=
@
_
;
#
Must
be
a
real
reference
.
return
-
1
if
(
! ref($self));
my
%
results
=
();
my
$
pid
=
$
self
->
pid
();
my
$
eid
=
$
self
->
eid
();
my
$
query_result
=
DBQueryWarn
(
"select n.node_id,n.status from reserved as r "
.
"left join node_status as n on n.node_id=r.node_id "
.
"where pid='$pid' and eid='$eid'"
);
return
-
1
if
(
!defined($query_result));
while
(
my
($
node_id
,$
status
)
=
$
query_result
->
fetchrow_array
())
{
$
results
{$
node_id
}
=
(($
status
eq
"up"
)
?
1
:
0
);
}
%$
prval
=
%
results
;
return
0
;
}
#
_Always_
make
sure
that
this
1
is
at
the
end
of
the
file
...
1
;
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