STAF does not currently provide a STAF variable containing a machine's IP
address. STAF does have this information, but we thought some people may
not want their machine's IP address exposed in a STAF variable.
You can view the IP address (e.g. Physical ID) of the machine submitting a
WHOAMI request to the MISC service as follows. Note that you have to
specify the host name (or IP address) so that you're using the ssl or tcp
interface for the machine, not "local" because then it is using the
"local" interface so the "Physical ID" will just be "local". For example,
if you submitted this request from machine StafAdmin, it would show you
the IP address of machine StafAdmin.
C:\>STAF StafAdmin MISC WHOAMI
Response
--------
Instance Name : STAF
Instance UUID : 0C353C4D701B000009318BE672636172
Request Number : 350
Interface : ssl
Logical ID : stafadmin.company.com
Physical ID : 9.99.99.999
Endpoint : ssl://stafadmin.company.com@6550
Machine : stafadmin.company.com
Machine Nickname: sharon
Local Request : No
Handle : 54
Handle Name : STAF/Client
User : none://anonymous
Trust Level : 3
Note that if there is no host name for a machine, then STAF will assign
the IP address as not only the "Physical ID" but also as the "Logical ID",
e.g. as its machine name, so that then STAF variable STAF/Config/Machine
would contain the IP address instead of a host name.
Also, note that when a STAF service request is submitted to a remote
machine, information about the requesting machine is provided, including
the IP address. So, if you wrote a custom STAF service (e.g. in Java,
C++, or Perl), then you would see that when a request is submitted to your
custom service, the RequestInfo object passed in to the service's
acceptRequest() method includes information about the machine that
submitted the request to your custom service, including its IP address
(e.g. in the physicalInterfaceID field within the RequestInfo object).
--------------------------------------------------------------
Sharon Lucas
IBM Austin, luc...@us.ibm.com
(512) 286-7313 or Tieline 363-7313
From: Zach Calvert <zachcalv...@gmail.com>
To: staf-users@lists.sourceforge.net
Date: 02/07/2011 03:16 PM
Subject: [staf-users] IP Address Variable Sharing?
So it looks like I'm going to be logging by IP address so that I can
get logs into a central location. The problem with this is that I
want another machine to know my IP address without looking it up by
host name. The reason for this is that we are using virtual machines
for the test simulation, and hostname resolution may/will have
conflicts in the near future. The VMs cannot be entirely fenced of
because we have a limited number of database servers, so they will be
shared. So, if I have 2 machines A and B, and I want A to provide its
IP address to B without lookup by hostname, does STAF have support for
this? Unfortunately, I went through the STAF variable list
STAF LOCAL VAR LIST
And none of the variables expose an IP address. I assume this is
complicated by possibilities of multiple nics, etc, so I reviewed
STAF LOCAL MISC QUERY INTERFACE tcp
But the IP address isn't exposed here, and I'm not even sure how I
would deliver it into a variable from such a command. I assume it is
possible to write a custom script to identify the ip address of the
machine I'm on followed by calling the STAF variable set, but I was
thinking this has to have been solved before...
Thanks,
Zach
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
staf-users mailing list
staf-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/staf-users