System Information Functions

In this section:

It is now possible to obtain and work with system information. This section describes the _sysinfo() and _chaninfo() functions.


Top of page

x
_sysinfo(): Information About the Server

The _sysinfo() function returns information about the current server. This function uses the following format:

_sysinfo(type)

type

keyword

The type of information that is to be obtained. Possible values include:

  • processor. Number of processors available to the server.

    A common use of the processor value is to regulate parallel operations to avoid over-committing processors and developing a CPU-availability delay.

  • version. Current server version (for example, 6.1.7).
  • shortversion. Current software version that is shortened to the primary release level (for example, 6.1).
  • debug. Determines if the debug trace level is set. Returns true or false.
  • deep. Determines if the deep trace level is set. Returns true or false.
  • external. Determines if the external trace level is set. Returns true or false.


x
_chaninfo(): Information About a Channel

The _chaninfo() function returns information about the specified channel. If the specified channel does not exist, an exception is generated when the function is evaluated. This function uses the following format:

_chaninfo(name, [,type])

where:

name

string

Is the name of the channel. If an asterisk (*) is specified, the current channel in which the function is running will be evaluated.

type

keyword

Is the type of information that is to be obtained. Possible values include:

  • state. The state of the channel. Possible values include:
    • active. The channel is available to process messages.
    • begin. The channel is starting.
    • retry. The channel is not processing messages and is awaiting a retry cycle.
    • config. The channel cannot process messages due to a configuration error.
    • stopping. A stop order has been issued. No further messages are being accepted, but the channel has not completed its work.
    • stopped. The channel is not active.
    • waiting. The channel is on a backup server and is not executing.
    • inactive. The channel was marked inactive in the configuration and awaits an explicit start command.
  • ispassive. Is the channel passivated. In some cases, such as an internal queue becoming too full, a passivate can be issued to a listener. Many listeners handle passivation automatically. However, some listeners require process flow support. In such a case, the passivate state test will return as true. The process flow may want to issue a sleep loop until the state becomes false, or take another action.
  • workers. The number of workers (threads) defined for the channel.
  • active. The number of messages currently being processed by the channel. A common use for this value is to regulate parallel operations to avoid over-committing processor resources.
  • debug. Determines if the debug trace level is set. Returns true or false.
  • deep. Determines if the deep trace level is set. Returns true or false.
  • external. Determines if the external trace level is set. Returns true or false.

The _chaninfo() function can also be run in a script. For example:

if(_chaninfo('ch1','state')='active',stop ch1)

iWay Software