Welcome Serena Central users! CLICK HERE
The migration of the Serena Central community is currently underway. Be sure to read THIS MESSAGE to get your new login set up to access your account.
David Taggart Respected Contributor.
Respected Contributor.
1556 views

Read hostname into a string?

Jump to solution

I'm deploying 24x7 monitoring using BMC's Transaction Execution Adapter agents. Is there some way to get the hostname of a server to which a Silk Performer project has been deployed, and read it into a string without relying on an external process?

0 Likes
2 Solutions

Accepted Solutions
David Taggart Respected Contributor.
Respected Contributor.

RE: Read hostname into a string?

Jump to solution
TEA agent, and it works. I see my hostname now show up in string. Complete!
0 Likes
David Taggart Respected Contributor.
Respected Contributor.

RE: Read hostname into a string?

Jump to solution
It was GetController(); which reported machine name both from Silk Performer 16.5, as well as BMC TrueSight Operations Management 10.1 .
0 Likes
6 Replies
Micro Focus Contributor
Micro Focus Contributor

RE: Read hostname into a string?

Jump to solution
Try the GetAgent function. In Silk Performer this will return the agent machine name but this is in the context of a loadtest with many agents connected to a controller. I have not tested this in trueSight to verify its behaviour but it could well be the same.

If that doesn't work as you want then there is definately a solution using commandline (ProcessInitialize (hostname command), java frameworks or .net frameworks without too much hassle. If such a solution is necessary then we can also get an enhancement logged for consideration of a function to do what you want - GetMonitorAgent or the like.
David Taggart Respected Contributor.
Respected Contributor.

RE: Read hostname into a string?

Jump to solution
That function returns "localhost", but I might be able to get what I need with GetController(); . I'll test it and report back.
0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Read hostname into a string?

Jump to solution
When you tested the GetAgent function was the monitor deployed to a tea agent or run locally as a TryScript?
0 Likes
David Taggart Respected Contributor.
Respected Contributor.

RE: Read hostname into a string?

Jump to solution
TEA agent, and it works. I see my hostname now show up in string. Complete!
0 Likes
Micro Focus Contributor
Micro Focus Contributor

RE: Read hostname into a string?

Jump to solution
For future readers, was it GetAgent or GetController that worked?
0 Likes
David Taggart Respected Contributor.
Respected Contributor.

RE: Read hostname into a string?

Jump to solution
It was GetController(); which reported machine name both from Silk Performer 16.5, as well as BMC TrueSight Operations Management 10.1 .
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.