We use the following code for to determine the server and instance
names:

 

<cfscript>

            // server name

            MachineName = createObject("java",
"java.net.InetAddress").localhost.getHostName();

            // instance name

            InstanceName = createObject("java",
"jrunx.kernel.JRun").getServerName();

</cfscript>

 

Tom

 

________________________________

From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Conrad Davis
Sent: Tuesday, April 24, 2007 9:48 AM
To: Dallas/Fort Worth ColdFusion User Group Mailing List
Subject: Re: [DFW CFUG] retrieving server IP

 

getServerName() was outputing the instance name, Aaron found this to
output the server name.

<cfset inet = CreateObject("java", "java.net.InetAddress")>
<cfset inet = inet.getLocalHost ()>
<cfoutput>#inet.getHostName()#</cfoutput>

On 4/24/07, Eric Knipp <[EMAIL PROTECTED] > wrote:

Conrad -

 

I forget the exact syntax but I did this before, and you need to
instantiate a java object that is able to get this information for you.
Its something like:

 

<cfset var serverName = createObject("java",
"jrunx.kernel.JRun").getServerName() />

 

Good luck

 

Eric

 

On 4/24/07, Conrad Davis <[EMAIL PROTECTED] > wrote: 

I could be wrong about exactly how we have this set up, but as far as I
know we have two servers and a load balancer to split the load across
the two, Dave or Aaron can provide more details if needed or if I am
totally wrong. 

What I need is a way to tell which server the session is on. Does
anybody know of a way to get the Windows hostname to ColdFusion?

_______________________________________________
Reply to DFWCFUG: 
  [email protected] <mailto:[email protected]> 
Subscribe/Unsubscribe:
 http://lists1.safesecureweb.com/mailman/listinfo/list 
List Archives:
   http://www.mail-archive.com/list%40list.dfwcfug.org/
 http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors:
  www.instantspot.com/ <http://www.instantspot.com/> 
 www.teksystems.com/



_______________________________________________
Reply to DFWCFUG:
 [email protected]
Subscribe/Unsubscribe: 
 http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives:
    http://www.mail-archive.com/list%40list.dfwcfug.org/
  http://www.mail-archive.com/list%40dfwcfug.org/
<http://www.mail-archive.com/list%40dfwcfug.org/> 
DFWCFUG Sponsors:
 www.instantspot.com/
  www.teksystems.com/ <http://www.teksystems.com/> 

 

_______________________________________________
Reply to DFWCFUG: 
  [email protected]
Subscribe/Unsubscribe: 
  http://lists1.safesecureweb.com/mailman/listinfo/list
List Archives: 
    http://www.mail-archive.com/list%40list.dfwcfug.org/             
  http://www.mail-archive.com/list%40dfwcfug.org/
DFWCFUG Sponsors: 
  www.instantspot.com/
  www.teksystems.com/

Reply via email to