Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
28b81395
Commit
28b81395
authored
Feb 03, 2003
by
Robert Ricci
Browse files
Modified to fit new fetchAll output, and made lack of bandwidth
information non-fatal.
parent
47d604f9
Changes
1
Hide whitespace changes
Inline
Side-by-side
db/grabron.in
View file @
28b81395
...
...
@@ -31,6 +31,8 @@ my $MAGICNODE = "ron2";
my
$logfile
=
"
$TB
/log/grabron
";
my
$debug
=
0
;
if
(
@ARGV
!=
1
)
{
die
"
Usage: $0 <url>
\n
";
}
...
...
@@ -46,7 +48,7 @@ $| = 1;
#
# Time in beteen polls
#
my
$interval
=
2
4
*
60
*
60
;
# 24 hours
my
$interval
=
2
5
*
60
*
60
;
# 24 hours
#
# Find out the interface to use for the TBDB_WIDEAREA_LOCALNODE, since I don't
...
...
@@ -60,8 +62,10 @@ if ($result->num_rows() != 1){
}
my
(
$localIface
)
=
(
$result
->
fetchrow
());
if
(
TBBackGround
(
$logfile
))
{
exit
(
0
);
if
(
!
$debug
)
{
if
(
TBBackGround
(
$logfile
))
{
exit
(
0
);
}
}
#
...
...
@@ -121,13 +125,12 @@ sub upload_times($$$) {
next
;
}
my
(
$node_id2
,
$iface2
)
=
@
{
$ipmap
{
$dst
}};
if
(
!
$bandwidths
{"
$node_id1
:
$iface1
$node_id2
:
$iface2
"})
{
my
$bandwidth
=
$bandwidths
{"
$node_id1
:
$iface1
$node_id2
:
$iface2
"};
if
(
!
defined
$bandwidth
)
{
warn
"
Got a pair (
$node_id1
:
$iface1
$node_id2
:
$iface2
) that has
"
.
"
no bandwidth
\n
";
$failed
++
;
next
;
$bandwidth
=
-
1
;
}
my
$bandwidth
=
$bandwidths
{"
$node_id1
:
$iface1
$node_id2
:
$iface2
"};
if
(
!
defined
(
$latency
))
{
#
# If no latency, that means we can't get there from here, so
...
...
@@ -229,14 +232,19 @@ sub get_times($) {
while
(
shift
@data
)
{
}
#
# XXX
: Temporary, until Dave fixes the "Plain Text" output, which isn't
#
reall
y
# XXX
- hack to work around oddity in fetchAll's output - it uses CRLF for
#
headers (the standard), but newlines for the bod
y
#
@data
=
split
/<p>|<\/p><p>|<\/p>/
,
$data
[
0
];
if
(
@data
==
1
)
{
@data
=
split
/\n/
,
$data
[
0
];
}
my
@return
;
foreach
my
$line
(
@data
)
{
chomp
$line
;
if
(
$debug
)
{
print
"
got line
$line
\n
";
}
if
(
!
(
$line
=~
/(\d+\.\d+.\d+\.\d+)\s+(\d+\.\d+.\d+\.\d+)\s+(\d+\.\d+)\s+(\d+\.\d+)\s+(\d+)\s+(\d+)/
)
)
{
warn
"
Bad data line:
$line
\n
";
next
;
...
...
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