perfsonar-dev - r1849 - in trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine: . tools
Subject: perfsonar development work
List archive
r1849 - in trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine: . tools
Chronological Thread
- From:
- To:
- Subject: r1849 - in trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine: . tools
- Date: Mon, 18 Dec 2006 10:45:29 -0500
Author: fernandes
Date: 2006-12-18 10:45:28 -0500 (Mon, 18 Dec 2006)
New Revision: 1849
Added:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineResourceProtector.java
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineAction.java
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineToolBundleFactory.java
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Bwctl.java
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Owamp.java
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Ping.java
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Traceroute.java
Log:
Latest CL-MP Changes for release
Added a simple internal Resource Protector
Fixed and added result codes
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineAction.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineAction.java
2006-12-18 15:37:49 UTC (rev 1848)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineAction.java
2006-12-18 15:45:28 UTC (rev 1849)
@@ -90,7 +90,7 @@
": UNSUPPORTED: Can only handle MeasurementRequest
message"
);
throw new RequestException(
- "error.mp.clmp.validator.unsuported_message_type",
+ "error.mp.clmp.validator.malformed_request",
ME_TYPE +
": UNSUPPORTED: Can only handle MeasurementRequest
message"
);
@@ -112,7 +112,7 @@
": Request must have at least one
EventType defined in at least one MetaData."
);
throw new RequestException(
-
"error.mp.clmp.validator.no_metadata_eventType",
+
"error.mp.clmp.validator.malformed_request",
ME_TYPE +
": Request must have at least one
EventType defined in at least one MetaData."
);
Added:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineResourceProtector.java
Property changes on:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineResourceProtector.java
___________________________________________________________________
Name: svn:keywords
+ Author Date Id Revision
Name: svn:eol-style
+ native
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineToolBundleFactory.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineToolBundleFactory.java
2006-12-18 15:37:49 UTC (rev 1848)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/CommandLineToolBundleFactory.java
2006-12-18 15:45:28 UTC (rev 1849)
@@ -133,7 +133,7 @@
"because of IllegalAccessException: " +
e.getMessage());
throw new SystemException(
- "error.mp.clmp.toolFactory.illegal_access",
+ "error.mp.clmp.toolFactory.cant_instantiate",
"CommandLineToolBundleFactory: Unable to Instantiate " +
"ToolBundle for: " + eventString +
"because of IllegalAccessException: " +
@@ -146,7 +146,7 @@
"create ToolBundle for: " + eventString +
" because: " + e.getMessage());
throw new SystemException(
- "error.mp.clmp.toolFactory.no_class",
+ "error.mp.clmp.toolFactory.cant_instantiate",
"CommandLineToolBundleFactory: Unable to " +
"create ToolBundle for: " + eventString +
" because: " + e.getMessage());
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Bwctl.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Bwctl.java
2006-12-18 15:37:49 UTC (rev 1848)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Bwctl.java
2006-12-18 15:45:28 UTC (rev 1849)
@@ -42,6 +42,7 @@
import
org.perfsonar.commons.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.commons.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.service.measurementPoint.commandLine.CommandLineExec;
+import
org.perfsonar.service.measurementPoint.commandLine.CommandLineResourceProtector;
import
org.perfsonar.service.measurementPoint.commandLine.CommandLineToolBundle;
public class Bwctl implements CommandLineToolBundle{
@@ -51,7 +52,8 @@
private Hashtable toolOptions = null;
protected LoggerComponent logger = null;
-
+ protected CommandLineResourceProtector protector = null;
+
public String getToolBundleName(){
return "Bwctl";
}
@@ -103,11 +105,11 @@
else {
logger.fatal(
CNAME +
- ": UNSUPPORTED: Must to have at least one
Subject defined in at least one MetaData currently"
+ ": UNSUPPORTED: Must have at least one Subject
defined in at least one MetaData currently"
);
- throw new RequestException(
+ throw new
RequestException("error.mp.clmp.validator.malformed_request",
CNAME +
- ": UNSUPPORTED: Must to have at least one
Subject defined in at least one MetaData currently"
+ ": UNSUPPORTED: Must have at least one Subject
defined in at least one MetaData currently"
);
}
}
@@ -116,11 +118,11 @@
if(subject == null){
logger.fatal(
CNAME +
- ": UNSUPPORTED: Must to have at least one Subject
defined in at least one MetaData currently"
+ ": UNSUPPORTED: Must have at least one Subject defined
in at least one MetaData currently"
);
- throw new RequestException(
+ throw new
RequestException("error.mp.clmp.validator.malformed_request",
CNAME +
- ": UNSUPPORTED: Must to have at least one Subject
defined in at least one MetaData currently"
+ ": UNSUPPORTED: Must have at least one Subject defined
in at least one MetaData currently"
);
}
@@ -205,9 +207,18 @@
String[] parametersList = new String[cmd.size()];
cmd.toArray(parametersList);
+ // Estimate timeout
+ int duration = 10;
+
+ p = params.getParameterByName("duration");
+ if(p != null)
+ duration = Integer.parseInt(p.getParameterValue());
+
+ System.out.println(cmd.toString() + "\nEstimated timeout:
"+((duration*1000)+30000));
+
// TODO: make timeout an option somehow
// timeout - 30 seconds
- cl.run_synchronous(30000, parametersList);
+ protector.run(cl, (duration*1000)+30000, parametersList);
datums = parseResults(cl);
/*for (int i = 0; i < datums.length; i++) {
@@ -219,11 +230,19 @@
CNAME + "Unable to execute command: " + "bwctl" + ": "
+ t.getMessage()
);
- throw new SystemException(
+ throw new SystemException("error.mp.clmp.exec",
CNAME + "Unable to execute command: " + "bwctl" + ": "
+ t.getMessage(),
t
);
+ }catch (NumberFormatException e){
+ logger.fatal(
+ CNAME + ": Parameters count and interval must be
integers."
+ );
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ CNAME + ": Parameter duration must be an integer.",
+ e
+ );
}
/*
@@ -243,6 +262,10 @@
Parameter p = null;
for (int j = 0; j < metadata.length; j++) {
+
+ if (metadata[j].getSubject() != null)
+ respMess.addChild(metadata[j]);
+
params = metadata[j].getParameters();
p = null;
if (params != null) {
@@ -471,7 +494,8 @@
public Bwctl() throws SystemException{
logger =
(LoggerComponent)AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.LOGGER);
-
+ protector =
(CommandLineResourceProtector)AuxiliaryComponentManager.getInstance().getComponent("clmprp");
+
toolOptions = new Hashtable();
/*
* toolOptions
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Owamp.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Owamp.java
2006-12-18 15:37:49 UTC (rev 1848)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Owamp.java
2006-12-18 15:45:28 UTC (rev 1849)
@@ -41,6 +41,7 @@
import
org.perfsonar.commons.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.commons.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.service.measurementPoint.commandLine.CommandLineExec;
+import
org.perfsonar.service.measurementPoint.commandLine.CommandLineResourceProtector;
import
org.perfsonar.service.measurementPoint.commandLine.CommandLineToolBundle;
public class Owamp implements CommandLineToolBundle{
@@ -50,7 +51,7 @@
private Hashtable toolOptions = null;
protected LoggerComponent logger = null;
-
+ protected CommandLineResourceProtector protector = null;
public String getToolBundleName(){
return "Owamp";
@@ -81,7 +82,7 @@
logger.fatal(
CNAME + "Unsupported: request can only have one Metadata"
);
- throw new SystemException(
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
CNAME + "Unsupported: request can only have one Metadata"
);
}
@@ -115,7 +116,22 @@
// TODO: Check config for cmd name
cmd.add("owping");
cmd.add("-R");
-
+
+ if (params != null) {
+ p = params.getParameterByName("direction");
+ if(p != null){
+ if
(p.getParameterValue().toLowerCase().equals("from"))
+ cmd.add("-f");
+ else if
(p.getParameterValue().toLowerCase().equals("to")) {
+ cmd.add("-t");
+ } else
+ //throw exception
+ ;
+ } else {
+ //default both directions test
+ }
+ }
+
cmd = cl.checkParameters(cmd, params, toolOptions);
// Check for dst addr
@@ -125,16 +141,23 @@
else{
cmd.add(dst.getValue());
}
-
+
// Now execute
String[] parametersList = new String[cmd.size()];
cmd.toArray(parametersList);
- System.out.println(cmd.toString());
+ // Estimate timeout
+ int count = 100;
+ p = params.getParameterByName("count");
+ if(p != null)
+ count = Integer.parseInt(p.getParameterValue());
+
+ System.out.println(cmd.toString() + "\nEstimated timeout:
"+((count*2000)+30000));
+
// TODO: make timeout an option somehow
// timeout - 30 seconds
- cl.run_synchronous(30000, parametersList);
+ protector.run(cl, (count*2000)+30000, parametersList);
datums = parseResults(cl);
/*for (int i = 0; i < datums.length; i++) {
@@ -146,11 +169,19 @@
CNAME + "Unable to execute command: " + "owamp" + ": "
+ t.getMessage()
);
- throw new SystemException(
+ throw new SystemException("error.mp.clmp.exec",
CNAME + "Unable to execute command: " + "owamp" + ": "
+ t.getMessage(),
t
);
+ }catch (NumberFormatException e){
+ logger.fatal(
+ CNAME + ": Parameters count and interval must be
integers."
+ );
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ CNAME + ": Parameter count must be an integer.",
+ e
+ );
}
/*
@@ -164,7 +195,7 @@
Message respMess = null;
respMess = new Message();
- respMess.setType("MeasurementArchiveStoreRequest");
+ respMess.setType("MeasurementResponse");
Data data = new Data();
data.setId("data1");
@@ -250,7 +281,8 @@
public Owamp() throws SystemException{
logger =
(LoggerComponent)AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.LOGGER);
-
+ protector =
(CommandLineResourceProtector)AuxiliaryComponentManager.getInstance().getComponent("clmprp");
+
toolOptions = new Hashtable();
/*
* toolOptions
@@ -264,7 +296,6 @@
toolOptions.put("timeOut","-L:");
toolOptions.put("padding","-s:");
toolOptions.put("delayStart","-z:");
- toolOptions.put("fromTestHost","-f:novalue");
- toolOptions.put("toTestHost","-t:novalue");
+ toolOptions.put("portRange","-P:");
}
}
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Ping.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Ping.java
2006-12-18 15:37:49 UTC (rev 1848)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Ping.java
2006-12-18 15:45:28 UTC (rev 1849)
@@ -41,6 +41,7 @@
import
org.perfsonar.commons.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.commons.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.service.measurementPoint.commandLine.CommandLineExec;
+import
org.perfsonar.service.measurementPoint.commandLine.CommandLineResourceProtector;
import
org.perfsonar.service.measurementPoint.commandLine.CommandLineToolBundle;
public class Ping implements CommandLineToolBundle{
@@ -48,9 +49,11 @@
static private final String CNAME="PingCommandLineToolBundle";
private Hashtable toolOptions = null;
+ private String OS = null;
protected LoggerComponent logger = null;
-
+ protected CommandLineResourceProtector protector = null;
+
public String getToolBundleName(){
return "Ping";
@@ -81,7 +84,7 @@
logger.fatal(
CNAME + "Unsupported: request can only have one Metadata"
);
- throw new SystemException(
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
CNAME + "Unsupported: request can only have one Metadata"
);
}
@@ -125,8 +128,13 @@
// Check for src addr
if((src != null) && !src.getValue().equals("*")){
-
- cmd.add("-I " + src.getValue());
+ if (OS.indexOf("linux") > -1) {
+ cmd.add("-I");
+ cmd.add(src.getValue());
+ } else if (OS.indexOf("freebsd") > -1) {
+ cmd.add("-S ");
+ cmd.add(src.getValue());
+ }
}
cmd = cl.checkParameters(cmd, params, toolOptions);
@@ -138,32 +146,50 @@
else{
cmd.add(dst.getValue());
}
-
+
// Now execute
String[] parametersList = new String[cmd.size()];
cmd.toArray(parametersList);
- System.out.println(cmd.toString());
+ // Estimate timeout
+ int count = 10, interval = 1;
+ p = params.getParameterByName("count");
+ if(p != null)
+ count = Integer.parseInt(p.getParameterValue());
+
+ p = params.getParameterByName("interval");
+ if(p != null)
+ interval = Integer.parseInt(p.getParameterValue());
+
+ System.out.println(cmd.toString() + "\nEstimated timeout:
"+((count*interval*1000)+30000));
+
// TODO: make timeout an option somehow
// timeout - 30 seconds
- cl.run_synchronous(30000, parametersList);
+ protector.run(cl, (count*interval*1000)+30000,
parametersList);
datums = parseResults(cl);
/*for (int i = 0; i < datums.length; i++) {
System.out.println(datums[i].toString());
}*/
- }
- catch (java.io.IOException t){
+ }catch (java.io.IOException t){
logger.fatal(
CNAME + "Unable to execute command: " + "ping" + ": "
+ t.getMessage()
);
- throw new SystemException(
+ throw new SystemException("error.mp.clmp.exec",
CNAME + "Unable to execute command: " + "ping" + ": "
+ t.getMessage(),
t
);
+ }catch (NumberFormatException e){
+ logger.fatal(
+ CNAME + ": Parameters count and interval must be
integers."
+ );
+ throw new
SystemException("error.mp.clmp.validator.malformed_request",
+ CNAME + ": Parameters count and interval must be
integers.",
+ e
+ );
}
/*
@@ -177,7 +203,7 @@
Message respMess = null;
respMess = new Message();
- respMess.setType("MeasurementArchiveStoreRequest");
+ respMess.setType("MeasurementResponse");
Data data = new Data();
data.setId("data1");
@@ -216,8 +242,7 @@
Matcher matcher = null;
while( (line = br.readLine()) != null){
matcher = datumPattern.matcher(line);
- //System.out.println(line);
- if (matcher.matches()) {
+ if (matcher.matches()) {
numBytes = matcher.group(1);
numBytesUnits = matcher.group(2);
@@ -226,13 +251,6 @@
value = matcher.group(5);
valueUnits = matcher.group(6);
- /*System.out.println(numBytes + " " +
- numBytesUnits + "
" +
- seqNum + " " +
- ttl + " " +
- value + " " +
- valueUnits);*/
-
datum = new Datum();
datum.setNumBytes(numBytes);
datum.setNumBytesUnits(numBytesUnits);
@@ -263,17 +281,28 @@
public Ping() throws SystemException{
logger =
(LoggerComponent)AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.LOGGER);
-
+ protector =
(CommandLineResourceProtector)AuxiliaryComponentManager.getInstance().getComponent("clmprp");
+
+ this.OS = System.getProperty("os.name").toLowerCase();
+
toolOptions = new Hashtable();
/*
* toolOptions
* KEY= parameter name
* VALUE= string containing [command line option]:[default value
(if any)]
*/
- toolOptions.put("count","-c:10");
- toolOptions.put("interval","-i:");
- toolOptions.put("deadline","-w:");
- toolOptions.put("packetSize","-s:");
- toolOptions.put("ttl","-t:");
+ if (OS.indexOf("linux") > -1) {
+ toolOptions.put("count","-c:10");
+ toolOptions.put("interval","-i:");
+ toolOptions.put("deadline","-w:");
+ toolOptions.put("packetSize","-s:");
+ toolOptions.put("ttl","-t:");
+ } else if (OS.indexOf("freebsd") > -1) {
+ toolOptions.put("count","-c:10");
+ toolOptions.put("interval","-i:");
+ toolOptions.put("deadline","-t:");
+ toolOptions.put("packetSize","-s:");
+ toolOptions.put("ttl","-m:");
+ }
}
}
Modified:
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Traceroute.java
===================================================================
---
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Traceroute.java
2006-12-18 15:37:49 UTC (rev 1848)
+++
trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine/tools/Traceroute.java
2006-12-18 15:45:28 UTC (rev 1849)
@@ -41,6 +41,7 @@
import
org.perfsonar.commons.auxiliary.components.configuration.ConfigurationComponent;
import org.perfsonar.commons.auxiliary.components.logger.LoggerComponent;
import org.perfsonar.service.measurementPoint.commandLine.CommandLineExec;
+import
org.perfsonar.service.measurementPoint.commandLine.CommandLineResourceProtector;
import
org.perfsonar.service.measurementPoint.commandLine.CommandLineToolBundle;
public class Traceroute implements CommandLineToolBundle{
@@ -48,8 +49,10 @@
static private final String CNAME="TracerouteCommandLineToolBundle";
private Hashtable toolOptions = null;
+ private String OS = null;
protected LoggerComponent logger = null;
+ protected CommandLineResourceProtector protector = null;
private int numQueries;
@@ -106,37 +109,23 @@
Parameters params = mdArr[0].getParameters();
Parameter p = null;
-
- numQueries = 3;
- if (params != null) {
- p = params.getParameterByName("numQueries");
- if(p != null){
- numQueries = Integer.parseInt(p.getParameterValue());
- }
- }
-
/*
* Build cmd array
*/
ArrayList cmd = new ArrayList();
Datum[] datums = null;
-
try{
- CommandLineExec cl = new CommandLineExec("traceroute");
+ CommandLineExec cl = new CommandLineExec("traceroute");
// cmd itself
// TODO: Check config for cmd name
cmd.add("traceroute");
cmd.add("-n");
- cmd.add("-l");
+ if (OS.indexOf("linux") > -1) {
+ cmd.add("-l");
+ }
// Check for src addr
- /*if((src != null) && !src.getValue().equals("*")){
-
- cmd.add("-s " + src.getValue());
- }*/
-
cmd = cl.checkParameters(cmd, params, toolOptions);
-
// Check for dst addr
if(dst == null){
//TODO: throw request exception
@@ -144,12 +133,17 @@
else{
cmd.add(dst.getValue());
}
-
if (params != null) {
p = params.getParameterByName("packetSize");
if(p != null){
cmd.add(p.getParameterValue());
}
+ p = params.getParameterByName("numQueries");
+ if(p != null){
+ this.numQueries =
Integer.parseInt(p.getParameterValue());
+ } else {
+ this.numQueries = 3;
+ }
}
// Now execute
@@ -160,7 +154,7 @@
// TODO: make timeout an option somehow
// timeout - 30 seconds
- cl.run_synchronous(30000, parametersList);
+ protector.run(cl, 60000, parametersList);
datums = parseResults(cl);
}
@@ -169,7 +163,7 @@
CNAME + "Unable to execute command: " + "traceroute" +
": "
+ t.getMessage()
);
- throw new SystemException(
+ throw new SystemException("error.mp.clmp.exec",
CNAME + "Unable to execute command: " + "traceroute" +
": "
+ t.getMessage(),
t
@@ -187,7 +181,7 @@
Message respMess = null;
respMess = new Message();
- respMess.setType("MeasurementArchiveStoreRequest");
+ respMess.setType("MeasurementResponse");
Data data = new Data();
data.setId("data1");
@@ -203,12 +197,14 @@
}
private Datum[] parseResults(CommandLineExec cle) {
+
String datumRegex =
"[^0-9]*([0-9]*)[^0-9]*(([0-9]{1,3}\\.){3}([0-9]{1,3}))";
- String datumQueryRegex =
"([^0-9]*([0-9\\.]*)[^a-zA-Z]*([a-zA-Z]*)[^\\(]*\\(([0-9]*)\\))?";
+ String datumQueryRegex =
"(([^0-9]*([0-9\\.]*)[^a-zA-Z]*([a-zA-Z]*)([^\\(]*\\(([0-9]*)\\))?)?|\\*)";
+
String hopMaxRegex = "[^\\,]*\\, ([0-9]*)[^\\,]*\\, ([0-9]*)
([a-zA-Z]*).*";
-
- for (int i = 0; i < numQueries; i++)
+ for (int i = 0; i < this.numQueries; i++)
datumRegex += datumQueryRegex;
+ datumRegex += ".*";
Pattern datumPattern = Pattern.compile(datumRegex);
Pattern hopMaxPattern = Pattern.compile(hopMaxRegex);
@@ -226,7 +222,6 @@
ArrayList datumList = new ArrayList();
try{
-
Datum datum = null;
String line = null;
@@ -236,8 +231,11 @@
InputStreamReader eisr = new InputStreamReader(efis);
BufferedReader ebr = new BufferedReader(eisr);
+
if ((line = ebr.readLine()) != null){
- System.out.println(line);
+ if (line.matches(".*multiple addresses.*"))
+ line = ebr.readLine();
+
matcher = hopMaxPattern.matcher(line);
if (matcher.matches()) {
hopMax = matcher.group(1);
@@ -249,34 +247,45 @@
FileInputStream fis = new FileInputStream(cle.getOsFile());
InputStreamReader isr = new InputStreamReader(fis);
BufferedReader br = new BufferedReader(isr);
-
+
while( (line = br.readLine()) != null){
matcher = datumPattern.matcher(line);
- System.out.println(line);
- if (matcher.matches()) {
-
+
+ if (matcher.matches()) {
seqNum = matcher.group(1);
hop =
matcher.group(2);
for (int i = 0; i < numQueries; i++) {
queryNum = String.valueOf(i +
1);
- value = matcher.group(6 +
(4*i));
- ttl =
matcher.group(7 + (4*i));
- valueUnits = matcher.group(6 +
(4*i));
-
- datum = new Datum();
- datum.setSeqNum(seqNum);
- datum.setHop(hop);
- datum.setHopMax(hopMax);
- datum.setTTL(ttl);
- datum.setQueryNum(queryNum);
- datum.setNumBytes(numBytes);
- datum.setNumBytesUnits(numBytesUnits);
- datum.setValue(value);
- datum.setValueUnits(valueUnits);
- datum.setTimeType("unix");
-
datum.setTimeValue(String.valueOf(System.currentTimeMillis()));
- datumList.add(datum);
+ value = matcher.group(7 +
(6*i));
+ valueUnits = matcher.group(8 +
(6*i));
+ ttl =
matcher.group(10 + (6*i));
+ if (value.length() > 0) {
+ datum = new Datum();
+ datum.setSeqNum(seqNum);
+ datum.setHop(hop);
+ datum.setHopMax(hopMax);
+ if (OS.indexOf("linux") > -1)
{
+ if (ttl != null) {
+ if
(ttl.length() > 0) {
+
datum.setTTL(ttl);
+ } else {
+
datum.setTTL("");
+ }
+ } else {
+
datum.setTTL("");
+ }
+ } else
+ datum.setTTL("");
+ datum.setQueryNum(queryNum);
+ datum.setNumBytes(numBytes);
+
datum.setNumBytesUnits(numBytesUnits);
+ datum.setValue(value);
+
datum.setValueUnits(valueUnits);
+ datum.setTimeType("unix");
+
datum.setTimeValue(String.valueOf(System.currentTimeMillis()));
+ datumList.add(datum);
+ }
}
}
}
@@ -298,7 +307,10 @@
public Traceroute() throws SystemException{
logger =
(LoggerComponent)AuxiliaryComponentManager.getInstance().getComponent(ComponentNames.LOGGER);
-
+ protector =
(CommandLineResourceProtector)AuxiliaryComponentManager.getInstance().getComponent("clmprp");
+
+ this.OS = System.getProperty("os.name").toLowerCase();
+
toolOptions = new Hashtable();
/*
* toolOptions
@@ -313,6 +325,6 @@
toolOptions.put("icmp","-I:novalue");
toolOptions.put("port","-p:");
toolOptions.put("tos","-t:");
- toolOptions.put("numQueries","-q:");
+ toolOptions.put("numQueries","-q:3");
}
}
- r1849 - in trunk/perfsonar/src/org/perfsonar/service/measurementPoint/commandLine: . tools, svnlog, 12/18/2006
Archive powered by MHonArc 2.6.16.