Yes, the System.isHostReachable(<ip or servername?,<timeout in MS>) works in VCO
EXAMPLE: System.isHostReachable(fakeservername,5000);
I've created a "ghetto" dual-stage ping, as sometimes the above will return a false negative ("hostname" being my input for servername or IP & "result" being my boolean output).
result = System.isHostReachable(hostname,5000);
if (result == false){
try{
System.log("SECONDARY PING STARTED");
var cmd = new String();
cmd = "ping -n 1 " + hostname;
var command = new Command(cmd);
command.execute(true);
var pingResultNumber = command.result;
var curlResult = command.output;
System.log(curlResult);
if(curlResult.trim().toLowerCase().indexOf("ms ttl") > -1 ){
System.log("Host "+hostname+" is responding to pings.");
result = true;
}else{
System.log("Host "+hostname+" is NOT responding to pings.");
result = false;
}
} catch (e) {
throw "Unable to execute command " + e;
}
}
else
{
System.log("Host "+hostname+" is responding to pings.");
result = true;
}