How to: Create an HTTP request for a situation

You can use the Take Action command HTTPRQ (HTTP Request) to create an HTTP request for a situation.

Before you begin

You can use the Take Action command HTTPRQ when creating a situation using any of the available methods (such as, Tivoli Enterprise Portal, enhanced 3270 user interface, tacmd CLI).

About this task

When defined for a situation, the Take Action command HTTPRQ creates an HTTP request when the situation occurs.

To use the command, when creating a situation, include the HTTPRQ Take Action command in the following format:
HTTPRQ url;hheader;drequest_body
Where:
  • url is the URL address for the request
  • header is the HTTP header for the request
  • request_body is the HTTP request body

The maximum length of the command is 256 characters.

Note: In addition to defining the HTTPRQ command as an action in a situation, you can also use the Tivoli Enterprise Portal Take Action feature to manually enter the HTTPRQ command.

Procedure

Using any of the available methods (such as, Tivoli Enterprise Portal, enhanced 3270 user interface, tacmd CLI), create a situation that includes Take Action command HTTPRQ.
When the situation occurs, the HTTP request is issued.

Example

The following examples show how to define the HTTPRQ command:
Plain text
The following example shows how to echo plain text:
HTTPRQ http://ip_address:port/echo;hContent-type: text/plain ;dText
Application
The following example shows how you could use the HTTPRQ command to post a message to the Slack application when the situation for which it is defined is true. This example also includes product variables.
Note: The example shows each part of the request on a new line for better visibility.
HTTPRQ https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX;
hContent-type: application/json;
d{"text":"&{Address_Space_CPU_Utilization.Job_Name} CPU use is &{Address_Space_CPU_Utilization.CPU_Percent}%"}