Creating an HTTP Monitor

Create an HTTP monitor in Health Checks.

    1. Open the navigation menu and click Observability & Management. Under Monitoring, click Health Checks.
    2. On the Health checks page, choose the compartment that you want to create the HTTP monitor in.
    3. Click Create health check.
    4. In the Create health check dialog box, enter the following values:
      • Health check name: Enter a name for the HTTP monitor. Avoid entering confidential information.

      • Select the compartment to run the health check in. A default value from the scope is provided.

      • For Targets, define the hosts that you want to monitor with this health check. For each host, specify either the IP address or the name (fully qualified domain name, or FQDN).

      • For Vantage points, optionally select up to ten locations to use for monitoring the targets. For more information, see Listing Vantage Points.

      • For Request type, select HTTP.

      • For Protocol, select the network protocol to use: HTTP or HTTPS.

        Important

        If you select HTTPS for an IP address target, you must specify a host header with the domain name associated with the TLS certificate for that target in the Headers section. If you don't add the host header, the TLS connection phase doesn't complete successfully and the target endpoint is declared unavailable. Note that this host header is required only with IP address targets and HTTPS monitors.
      • For Port, select the port to use for the connection.

        Default values are 80 for HTTP protocol and 443 for HTTPS protocol.

      • For Target path (HTTP protocol), optionally specify the path on the target that you want to monitor. For example, for the target www.example.com, to monitor www.example.com/project/help.htm, specify /project/help.htm.

      • For Header name, optionally define a name to display in the request header as part of the health check. Avoid entering confidential information.

      • For Header value, optionally specify data to request.

        Click + Additional Header to add another header.

      • For Method, select the HTTP method to use.

      • For Timeout, define the maximum time to wait for a reply before marking the health check as failed.

      • For Interval, specify the period of time between health checks of the target.

    5. (Optional) Tag the new HTTP monitor.
      • Tag namespace: To add a defined tag, select an existing namespace. If you're adding a free-from tag, leave this field blank.

      • Tag key: To add a defined tag, select an existing tag key. To add a free-form tag, type the key name that you want.

      • Tag value: Type the tag value that you want.

    6. Click Create health check.
    The details page for the new HTTP monitor opens. Results appear after a few moments.
  • Use the oci health-checks http-monitor create command and required parameters to create an HTTP monitor:

    oci health-checks http-monitor create --compartment-id <compartment_OCID> --display-name <name> --interval-in-seconds <number> --targets <json_file_or_string>

    For a complete list of parameters and values for CLI commands, see the CLI for Health Checks.

  • Run the CreateHttpMonitor operation to create an HTTP monitor.

    Example Request and Response

    The following example request creates an HTTP monitor to check the health of www.example.com using GET requests over HTTPS protocol every 30 seconds.

    POST /20180501/httpMonitors
    {
       "compartmentId":"ocid1.compartment.oc1..<unique_ID>",
       "displayName":"Example HTTP Monitor",
       "intervalInSeconds":30,
       "method":"GET",
       "port":443,
       "protocol":"HTTPS",
       "targets":["www.example.com"],
       "timeoutInSeconds":30
    }

    Following is an example 200 response for successful creation of the previously defined HTTP monitor. The resultsUrl field indicates the URL for retrieving results.

    {
       "id":"ocid1.httpmonitor.OC2...<unique_ID>",
       "resultsUrl":"https://healthchecks.us-ashburn-1.oraclecloud.com/20180501/httpProbeResults/ocid1.httpmonitor.OC2...<unique_ID>",
       "compartmentId":"ocid1.compartment.oc1..<unique_ID>",
       "definedTags":{},
       "displayName":"Example HTTP Monitor",
       "freeformTags":{},
       "homeRegion":"us-ashburn-1",
       "intervalInSeconds":30,
       "isEnabled":true
       "method":"GET",
       "port":443,
       "protocol":"HTTPS",
       "targets":["www.example.com"],
       "timeCreated":"2022-11-07T16:32:05.451057Z"
       "timeoutInSeconds":30,
       "vantagePointNames":["azr-sat","goo-cbf","aws-fra"]
    }