Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
emulab-devel
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Emmanuel Cecchet
emulab-devel
Commits
88149f3f
Commit
88149f3f
authored
18 years ago
by
Dan Gebhardt
Browse files
Options
Downloads
Patches
Plain Diff
minor changes to fix bug with the managerID
parent
548c15bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pelab/bgmon/libwanetmon.pm
+22
-5
22 additions, 5 deletions
pelab/bgmon/libwanetmon.pm
with
22 additions
and
5 deletions
pelab/bgmon/libwanetmon.pm
+
22
−
5
View file @
88149f3f
...
@@ -22,6 +22,7 @@ require Exporter;
...
@@ -22,6 +22,7 @@ require Exporter;
stopnode
stopnode
edittest
edittest
killnode
killnode
getstatus
);
);
...
@@ -111,10 +112,14 @@ sub sendcmd($$)
...
@@ -111,10 +112,14 @@ sub sendcmd($$)
my
$node
=
$_
[
0
];
my
$node
=
$_
[
0
];
my
$hashref
=
$_
[
1
];
my
$hashref
=
$_
[
1
];
my
%cmd
=
%$hashref
;
my
%cmd
=
%$hashref
;
if
(
!
defined
$cmd
{
managerID
}
){
$cmd
{
managerID
}
=
"
default
";
}
my
$sercmd
=
serialize_hash
(
\
%cmd
);
my
$sercmd
=
serialize_hash
(
\
%cmd
);
my
$f_success
=
0
;
my
$f_success
=
0
;
my
$max_tries
=
3
;
my
$max_tries
=
3
;
my
$retval
;
do
{
do
{
$socket
=
IO::Socket::
INET
->
new
(
PeerPort
=>
$port
,
$socket
=
IO::Socket::
INET
->
new
(
PeerPort
=>
$port
,
Proto
=>
'
tcp
',
Proto
=>
'
tcp
',
...
@@ -126,8 +131,8 @@ sub sendcmd($$)
...
@@ -126,8 +131,8 @@ sub sendcmd($$)
$sel
->
add
(
$socket
);
$sel
->
add
(
$socket
);
my
(
$ready
)
=
$sel
->
can_read
(
2
);
#timeout (seconds) (?)
my
(
$ready
)
=
$sel
->
can_read
(
2
);
#timeout (seconds) (?)
if
(
defined
(
$ready
)
&&
$ready
eq
$socket
){
if
(
defined
(
$ready
)
&&
$ready
eq
$socket
){
my
$ack
=
<
$ready
>
;
my
$ack
;
#
chomp $ack
;
(
$ack
,
$retval
)
=
<
$ready
>
;
if
(
defined
$ack
&&
(
(
chomp
(
$ack
),
$ack
)
eq
"
ACK
")
){
if
(
defined
$ack
&&
(
(
chomp
(
$ack
),
$ack
)
eq
"
ACK
")
){
$f_success
=
1
;
$f_success
=
1
;
# print "Got ACK from $node for command\n";
# print "Got ACK from $node for command\n";
...
@@ -136,6 +141,8 @@ sub sendcmd($$)
...
@@ -136,6 +141,8 @@ sub sendcmd($$)
}
else
{
}
else
{
$max_tries
--
;
$max_tries
--
;
}
}
chomp
$retval
if
(
defined
$retval
);
}
else
{
}
else
{
$max_tries
--
;
$max_tries
--
;
}
}
...
@@ -154,7 +161,7 @@ sub sendcmd($$)
...
@@ -154,7 +161,7 @@ sub sendcmd($$)
}
elsif
(
$f_success
==
1
){
}
elsif
(
$f_success
==
1
){
#success!
#success!
delete
$deadnodes
{
$node
};
delete
$deadnodes
{
$node
};
return
1
;
return
(
1
,
$retval
)
;
}
}
}
}
...
@@ -194,11 +201,21 @@ sub edittest($$$;$)
...
@@ -194,11 +201,21 @@ sub edittest($$$;$)
testper
=>
$testper
,
testper
=>
$testper
,
limitTime
=>
$limitTime
);
limitTime
=>
$limitTime
);
return
sendcmd
(
$srcnode
,
\
%cmd
);
return
$
{[
sendcmd
(
$srcnode
,
\
%cmd
)
]}[
0
]
;
}
}
sub
getstatus
($){
my
(
$node
)
=
@_
;
my
%cmd
=
(
expid
=>
$expid
,
cmdtype
=>
"
GETSTATUS
"
);
my
@cmdresult
=
sendcmd
(
$node
,
\
%cmd
);
if
(
defined
$cmdresult
[
1
]
){
return
$cmdresult
[
1
];
}
else
{
return
"
error
";
}
}
1
;
1
;
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment