Dear experts - we have a requirement to resolve IP or FQDN from running vRO node in HA (cluster) environment - do you have any suggestions on how to go about it ?
thanks a bunch!
Alex
Partial solution for this (found out googling):
Try the following (retrieves the information using standard Linux commands):
var command = new Command("hostname");
var ret = command.execute(true);
if (ret == 0) {
System.log("hostname: " + command.output.trim());
} else {
System.log("Error -> " + ret);
}
command = new Command("hostname -f");
ret = command.execute(true);
if (ret == 0) {
System.log("FQDN: " + command.output.trim());
} else {
System.log("Error -> " + ret);
}
command = new Command("hostname -i");
ret = command.execute(true);
if (ret == 0) {
System.log("IP: " + command.output.trim());
} else {
System.log("Error -> " + ret);
}
thanks for replying, the solution above though gets authorization error, one of the settings needs to be tweaked to get it to work.
One of our developers found this solution to the problem:
// Get information about this vRO
var netInterface = Config.getNetworkInterfaces();
var thisIP = netInterface.getBindInterface();
System.log("This IP = "+thisIP);
var thisHostName = System.resolveIpAddress(thisIP);
System.log("This host name = "+thisHostName);
Hi IIian,
I have a similar need to log the FQDN name of the vRO. Your method needs a property needs to be added in the vRO config which is not allowed due to security restrictions.
Neither this method suggested another person is available in vRO.
var netInterface = Config.getNetworkInterfaces();
Do you have anyother way of logging the vRO hostname in the log file?