Skip to Content.
Sympa Menu

perfsonar-user - Re: [perfsonar-user] Always get 0 returns through owamp data query.

Subject: perfSONAR User Q&A and Other Discussion

List archive

Re: [perfsonar-user] Always get 0 returns through owamp data query.


Chronological Thread 
  • From: Jason Zurawski <>
  • To: Jialu Pu <>
  • Cc:
  • Subject: Re: [perfsonar-user] Always get 0 returns through owamp data query.
  • Date: Mon, 26 Jul 2010 12:42:41 -0400
  • Organization: Internet2

Hi Jialu;

Looks like there is an error in the documentation. 'gmtime' does not return a timestring in the correct format (e.g. epoch seconds):


jason@hardy:~$
perl -e 'print gmtime() . "\n"'
Mon Jul 26 11:19:22 2010


To get around this I would use 'time', which does return in epoch format:


jason@hardy:~$
perl -e 'print time() . "\n"'
1280143174


I will correct this on the online documentation. Thanks;

-jason


On 7/26/10 12:22 PM, Jialu Pu wrote:
I was able to get the endpoints of a site and modify the example code
http://psps.perfsonar.net/client-doc.html#MA_BWOW_4
to get owamp data.

I tried to run the perl script to get data in
http://ndb1.internet2.edu/perfAdmin/delayGraph.cgi?url=http://sunn-owamp.es.net:8085/perfSONAR_PS/services/pSB&key=88a7e2cc11f905272aac4f7263c10e5f&key2=70eba7b7035a762918944053eafd909f&dst=198.129.254.78&src=198.129.254.54&dhost=sunn-owamp.es.net&shost=pnwg-owamp.es.net&length=86400
<http://ndb1.internet2.edu/perfAdmin/delayGraph.cgi?url=http://sunn-owamp.es.net:8085/perfSONAR_PS/services/pSB&key=88a7e2cc11f905272aac4f7263c10e5f&key2=70eba7b7035a762918944053eafd909f&dst=198.129.254.78&src=198.129.254.54&dhost=sunn-owamp.es.net&shost=pnwg-owamp.es.net&length=86400>

I tried both ipv4 and hostname. I also tried other endpoints which is
returned from MA.
But it gives 'query returned 0 result".

The code:

#!/usr/bin/perl
use FindBin;
use lib ("$FindBin::Bin/lib");
use perfSONAR_PS::Client::MA;
use XML::Twig;

# Create client
my $ma = new perfSONAR_PS::Client::MA( { instance =>
'http://sunn-owamp.es.net:8085/perfSONAR_PS/services/pSB' } );

# Define subject
my $subject = "<owamp:subject
xmlns:owamp=\"http://ggf.org/ns/nmwg/tools/owamp/2.0/\"; id=\"subject\">\n";
$subject .= " <nmwgt:endPointPair
xmlns:nmwgt=\"http://ggf.org/ns/nmwg/topology/2.0/\";>";
$subject .= " <nmwgt:src type=\"ipv4\" value=\"198.129.254.54\"/>";
$subject .= " <nmwgt:dst type=\"ipv4\" value=\"198.129.254.78\"/>";
$subject .= " </nmwgt:endPointPair>";
$subject .= "</owamp:subject>\n";

my @eventTypes = ();

# Set time range
my $end = gmtime;
my $start = $end - 24*3600; #1 day ago

# Send the request
my $result = $ma->setupDataRequest(
{
subject => $subject,
eventTypes =>
\@eventTypes,
start => $start,
end => $end,
}
);

#Output XML
my $twig= XML::Twig->new(pretty_print => 'indented');
foreach $metadata(@{$result->{"metadata"}}){
$twig->parse($metadata);
$twig->print();
}
foreach $data(@{$result->{"data"}}){
$twig->parse($data);
$twig->print();
}




Thanks.
Jialu Pu



Archive powered by MHonArc 2.6.16.

Top of Page