Charuganga
Contributor
Contributor

How to find localhost of the current working node for fetching workflow token logs in vRO 8.1

Not able to find the current working node in vRA 3  node architecture, we were easily able to find the current working using "localhost" command till vRO 7.6 to connect with the vRA appliance and fetch the vRO workflow token runs logs.

 

Labels (2)
Tags (2)
0 Kudos
4 Replies
Jeff_CH
Enthusiast
Enthusiast

This can be done like this:

var command = new Command("printenv");
command.execute(true);
var out = command.output;
var prop = "-Dvco.app.hostname=";
var posStart = out.indexOf(prop);
var posSpace = out.indexOf(" ", posStart);
var vROHostname = out.substring(posStart + prop.length, posSpace);

0 Kudos
Charuganga
Contributor
Contributor

Thanks  Jeff_CH.

The code  is returning VIP as a output, as we have 3 node behind VIP.

The requirement is to find out the current node on which the workflow execution logs are present.

We want current node as a output because then only we can take workflow logs of the current workflow token execution.

Please let me know if any clarification required from my end. 

 

Regards

Charu Ganga

0 Kudos
Jeff_CH
Enthusiast
Enthusiast

Hi Charu,

I can't test that setup with me, but following shows the complete string which also includes the local vRO IP (also shown in the output), you'll need to resolve that IP to the hostname then:

var command = new Command("printenv");
command.execute(true);
var out = command.output;
var prop = "JAVA_PROXY_NON_PROXY=";
var posStart = out.indexOf(prop);
var posSpace = out.indexOf("LANG=", posStart);
var tempSubstring = out.substring(posStart + prop.length, posSpace);
System.log("Complete string : " + tempSubstring);

var vROHostIP = tempSubstring.split("|")[8];
System.log("vRO-Node IP : " + vROHostIP);

 

Hope this works for you.

0 Kudos
Charuganga
Contributor
Contributor

Thank you...

This didn't fit for us, as the appliances  are behind the Load Balancer.

We are now using "Configuration element" to check logs on all the three nodes.

0 Kudos