Automation Engine Script Guide > Ordered by Function > System Conditions and Settings > SYS_HOST_ALIVE

SYS_HOST_ALIVE

Script Function: It checks whether a particular host is active.

Syntax

SYS_HOST_ALIVE(Host, [Connection])

Syntax

Description/Format

Host

The name of the agent whose activity should be checked.
Format: AE name or script variable

Connection

The name of an R3 or DB-type Connection object that should be used to verify the availability of the SAP system or the databaseA database is an organized collection of data including relevant data structures..
Format: AE name or script variable 

In SAP, you must enter the Connection object that you have defined in the Agent object's Agent tab.

The parameter Host is optional when you specify a DB-type Connection object.

To use this parameter, you must specify either an SAP agent or a database agent in Host. The system will not check whether the database agent has started in order to resolve SQL variables.


Return codes

A host has been specified:

"Y" - The agent is active.
"N" - The agent is inactive.

A host plus a Connection object have been specified:

"Y" - The agent is active and the SAP system or the database is available.
"N" - The agent is active but it cannot establish a connection to the SAP system or to the database.
"?" - The agent is not active. It cannot be identified whether or not the SAP system or the database is available.

Comments

OS Agents 

The script function checks whether the agent is active. You cannot specify the parameter Connection.

ERP Agents

ERP agent Peoplesoft, OracleApplications and Siebel: The value "N" is supplied when the agent is active but the Enterprise Business Solution is not available.

SAP agents: There are two options. You can only specify the parameter Host in order to check whether the SAP agent is active. To check whether the SAP system is available, you can additionally specify the corresponding SAP Connection object. 

Note that the SAP agent will open some connections only if they are required (HTTP) or terminate them automatically if they have not been used for a certain time (ABAP). A new connection will be established if there is no connection to the SAP system when you use SYS_HOST_ALIVE in order to check whether the SAP system is available. In this context, the following notes are important: 

Database Agent 

As in SAP, you can either specify only the agent, or a Connection object (type DB) in addition. If you specify a Connection object, you can also check the availability of the particular database.

Examples

The following example checks whether the Windows agent WIN21 is active. A message is sent to the administrator when it is inactive.

:IF SYS_HOST_ALIVE("WIN21") = "N"
:   
SEND_MSG "ADMIN","AE","Agent WIN21 is not active!"
:
ENDIF

The second example checks whether the SAP system is available for the agent SAP01.

:SET &STATUS# = SYS_HOST_ALIVE("SAP01", "CONN.R3.ECC.ABAP")

 

See also:

Script element Description

SYS_ACT_HOST

Returns the name of the host.

Script Elements - System Conditions and Settings

Sample Collection:
Display with Cockpit

About Scripts
Script Elements - Alphabetical Listing

Script Elements - Ordered by Function