tcl_platform

tcl_platform - A variable that contains platform specific information



Description

A variable that contains platform specific information. In general, this variable holds useful data concerning the platform on which a specific Tcl interpreter is running. Starting in BIG-IP v10.0.0, information specific to BIG-IP is also provided.
Note that if a virtual server accesses a normal global variable (such as tcl_platform) via an iRule, the virtual server would not be compatible with CMP and would be demoted to run on a single node. The static namespace has been provided to allow general access to constant global values in a CMP-compatible fashion. In this way, the tcl_platform array can be accessed via static::tcl_platform to be CMP-compatible.

Syntax

tcl_platform(os)
tcl_platform(osVersion)
tcl_platform(tmmVersion)
tcl_platform(byteOrder)
tcl_platform(platform)
tcl_platform(wordsize)

v11 Additions/Changes:
tcl_platform(machine)

tcl_platform(os)

  • Returns “BIG-IP”.

tcl_platform(osVersion)

  • Returns the version of BIG-IP that is currently running (ex: “10.0.0”).

tcl_platform(tmmVersion)

  • Returns the version of TMM that is currently running (ex: “10.0.0.5401.0”). This includes the build number, which may be useful for determining if a particular hotfix is installed.

tcl_platform(byteOrder)

  • Returns the byte order of the system (ex: littleEndian)

tcl_platform(platform)

  • Returns the operating system type (ex: unix)

tcl_platform(wordSize)

  • Returns the word size of the system (ex: 4)

tcl_platform(machine)

  • Returns the hostname of the BIG-IP

Note: As the examples show below, the tcl_platorm variables are already defined in the static namespace, so you can just reference them in any event by prepending with $static::

Examples

when HTTP_RESPONSE {
  HTTP::header insert "X-Served-By" "BIG-IP v$static::tcl_platform(osVersion)"
}

when RULE_INIT {
  upvar #0 tcl_platform static::tcl_platform # Sol #14544
  log local0. "Printing entire tcl_platform() array:"
  foreach key [array names static::tcl_platform] {
    log local0. "tcl_platform($key) = $static::tcl_platform($key)"
  }
}

Log output:

<RULE_INIT>: Printing entire tcl_platform() array:
<RULE_INIT>: tcl_platform(tmmVersion) = 11.0.0.8037.0
<RULE_INIT>: tcl_platform(osVersion) = 11.0.0
<RULE_INIT>: tcl_platform(byteOrder) = littleEndian
<RULE_INIT>: tcl_platform(machine) = ve11.example.com
<RULE_INIT>: tcl_platform(platform) = unix
<RULE_INIT>: tcl_platform(os) = BIG-IP
<RULE_INIT>: tcl_platform(wordSize) = 8