Previous Topic: STARTMODE Statement—Specify Startmode for Readied JobNext Topic: STEPUSER Statement—Specify the SAP System User the ABAP Runs Under


STATUS Statement—Specify the Status of the Process, Service, or IP Address to Monitor

The STATUS statement specifies the status of the process, service, or IP address to monitor. The job checks whether the status of the process, service, or IP address matches the status specified by this statement.

Supported Job Types

This statement is required for the following job types:

Syntax

This statement has the following format:

RUNNING

Specifies that the job monitors the process, service, or IP address for a running status.

STOPPED

Specifies that the job monitors the process, service, or IP address for a stopped status.

CONTINUE_PENDING

Specifies that the job monitors the Windows service for a continue pending status.

PAUSE_PENDING

Specifies that the job monitors the Windows service for a pause pending status.

PAUSED

Specifies that the job monitors the Windows service for a paused status.

START_PENDING

Specifies that the job monitors the Windows service for a start pending status.

STOP_PENDING

Specifies that the job monitors the Windows service for a stop pending status.

EXISTS

Specifies that the job checks whether the Windows service exists.

NOTEXISTS

Specifies that the job checks whether the Windows service does not exist.

NOW

Returns the status of the process, service, or IP address immediately.

Note: If the current status matches the status type, the job completes successfully; otherwise, the job fails.

WAIT

Monitors the process, service, or IP address continuously until it reaches the specified status.

Note: On UNIX and i5/OS, you can only specify the RUNNING, STOPPED, NOW, and WAIT operands.

Example: Monitor a Stopped Process

This example monitors the Bayuser process. The job checks the process status immediately and completes successfully if the process is stopped. If the process is running, the job fails.

AGENT SYSAGENT
PROCESS Bayuser
STATUS STOPPED NOW

Example: Monitor a Running Process

This example monitors the nlnotes process. If the process is running, the job completes successfully. If the process is not running, the job continues monitoring it until the process starts running.

AGENT SYSAGENT
PROCESS nlnotes
STATUS RUNNING WAIT

Example: Monitor the Agent Process on Windows Using a Full Path

Suppose that the WINAGENT computer runs multiple agents. To monitor the cybAgent.exe process, the full path to that process is specified. The job checks the process status immediately and completes successfully if the process is running. If the process is not running, the job fails. The process name is enclosed in single quotes because it contains a space.

AGENT WINAGENT
PROCESS 'c:\Program files\agentdir\cybAgent.exe'
STATUS RUNNING NOW

Note: For a UNIX example, substitute a UNIX path in the PROCESS statement.

Example: Monitor an IP Address for a Running Status

This example monitors a device at IP address 10.1.2.20 and port 22. When the job runs, it immediately checks if the device is running. If the device is running, the job completes. If the device is not running, the job fails.

AGENT SYSAGENT
IPADDRESS 10.1.2.20
IPPORT 22
STATUS RUNNING NOW

Example: Monitor a Running Service

This example monitors a Windows service named Proc Server. If the service is running, the job completes successfully. If the service is not running, the job continues monitoring it until the service starts running.

AGENT WINAGENT
SERVICENAME 'Proc Server'
STATUS RUNNING WAIT