Привет Попробуйте этот код,
package testapp;
import java.io.DataInputStream;
import java.io.IOException;
/**
*
* @author siva
*/
public class TestApp {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
try {
String ls_str;
String cmd="check_ping -H 192.168.1.2 -w 100.0,90% -c 200.0,60%";
String cmd1="/bin/ls -aFl";
Process ls_proc = Runtime.getRuntime().exec(cmd);
// get its output (your input) stream
DataInputStream ls_in = new DataInputStream(
ls_proc.getInputStream());
try {
while ((ls_str = ls_in.readLine()) != null) {
System.out.println(ls_str);
}
} catch (IOException e) {
System.exit(0);
}
} catch (IOException e1) {
System.err.println(e1);
System.exit(1);
}
System.exit(0);
}
}