Checks

A check is a foundational building block of the monitoring system. The check defines what to monitor and how to monitor. When you define a check, you specify attributes like the following:

  • the parts or pieces of the entity that you want to monitor,
  • monitoring frequency
  • number of monitoring zones originating the check

You can create up to 1000 checks.

After you create a check, you must create an alarm so that the check sends notifications when it is triggered. Alarms operate on a single check, and you can configure multiple alarms for a single check. For example, you might set up a check with two alarms to ensure that an HTTPS server is responding and that it has a valid certificatej.

Note

For more information, see the Check types reference.

Checks are associated with a parent entity, therefore the REST URLs for checks are underneath the entity with which they are associated.

Attributes used for all checks

NameDescriptionValidation
typeThe type of check Immutable

String between 1 and 64 characters long
detailsDetails specific to the check type. Optional

Hash [String,String between 1 and 255 characters long: Optional]

* Array or object with number of items between 0 and 256
disabledDisables the check. Optional

Boolean
labelA friendly label for a check. Optional

String between 1 and 255 characters long
metadataArbitrary key/value pairs. Optional

Hash [String,String between 1 and 255 characters long: Optional]

* Array or object with number of items between 0 and 256
periodThe period in seconds for a check. The value must be greater than the minimum period set on your account. Optional

Integer

* Value (30..1800)
timeoutThe timeout in seconds for a check. This has to be less than the period. Optional

Integer

* Value (2..1800)

Attributes used for remote checks

NameDescriptionValidation
monitoring_zones_pollList of monitoring zones to poll from. Note: This argument is only required for remote (non-agent) checks. Optional

Array [String]
target_aliasA key in the entity’s ip_addresses hash used to resolve this check to an IP address. This parameter is mutually exclusive with target_hostname. Optional

String between 1 and 64 characters long
target_hostnameThe hostname this check should target. This parameter is mutually exclusive with target_alias. Optional

Valid FQDN, IPv4, or IPv6 address
target_resolverDetermines how to resolve the check target. Optional

IPv4 or IPv6

Use the following Check API operations to create, test, and manage checks and check configuration.

Create a check

POST /entities/{entityId}/checks

Create a new check in the monitoring system by using a valid set of attributes from the checks attributes table. For an example of creating some basic checks, see Creating a check in the Rackspace Cloud Monitoring Getting Started Guide.

A newly-created check does not trigger notifications until you create an alarm to generate notifications. You associate alarms with a single check. You can have multiple alarms for a check, for example “alert if an HTTPS server is not responding and if it has an invalid certificate,” but you cannot create a single alarm and associate it with multiple checks.

The following table shows the possible response codes for this operation:

Response CodeNameDescription
201Created‘Location’ header contains a link to the newly created check.
400Bad requestThe system received an invalid value in a request.
401UnauthorizedThe system received a request from a user that is not authenticated.
403ForbiddenThe system received a request that the user is not authorized to make.
500Internal Server ErrorAn unexpected condition was encountered.
503Service UnavailableThe system is experiencing heavy load or another system failure.

Request

The following table shows the header parameters for the request:

NameTypeDescription
X-Auth-TokenString (Required)A valid authentication token with administrative access. For details, see Get your credentials

Example Create check: JSON request

{
"label": "Website check 1",
"type": "remote.http",
"details": {
"url": "http://www.foo.com",
"method": "GET"
},
"monitoring_zones_poll": [
"mzA"
],
"timeout": 30,
"period": 100,
"target_alias": "entity_ip_addresses_hash_key"
}

Response

This operation does not return a response body.

Test a check

POST /entities/{entityId}/test-check

This operation causes Rackspace Cloud Monitoring to attempt to run the check on the specified monitoring zones and return the results. This operation enables you to test the check parameters in a single step before the check is actually created in the system.

Note

You can copy the results of a test check response and paste it directly into a test alarm.

The following table shows the possible response codes for this operation:

Response CodeNameDescription
200OKRequest completed.
400Bad requestThe system received an invalid value in a request.
401UnauthorizedThe system received a request from a user that is not authenticated.
403ForbiddenThe system received a request that the user is not authorized to make.
404Not FoundThe URL, entity, or account requested is not found in the system.
500Internal Server ErrorAn unexpected condition was encountered.
503Service UnavailableThe system is experiencing heavy load or another system failure.

Request

The following table shows the header parameters for the request:

NameTypeDescription
entityIdString (Required)The ID for the monitoring zone. Use the List entities operation to find the entityId if you don’t know it.
X-Auth-TokenString (Required)A valid authentication token with administrative access. For details, see Get your credentials

Example Test check: JSON request

{
"type": "remote.http",
"details": {
"url": "http://www.foo.com",
"method": "GET"
},
"monitoring_zones_poll": [
"mzA"
],
"timeout": 30,
"target_alias": "default"
}

Response

Example Test check: JSON response

[
{
"timestamp": 1319222001982,
"monitoring_zone_id": "mzxJ4L2IU",
"available": true,
"status": "code=200,rt=0.257s,bytes=0",
"metrics": {
"bytes": {
"type": "i",
"data": "0"
},
"tt_firstbyte": {
"type": "I",
"data": "257"
},
"tt_connect": {
"type": "I",
"data": "128"
},
"code": {
"type": "s",
"data": "200"
},
"duration": {
"type": "I",
"data": "257"
}
}
}
]

Test a check with debug

POST /entities/{entityId}/test-check

Test a check and include extra check type-specific debugging information, if available.

This operation causes Rackspace Cloud Monitoring to attempt to run the check on the specified monitoring zones and return the results. This enables you to test the check parameters in a single step before the check is actually created in the system. This call also includes debug information. Currently debug information is only available for the remote.http check and includes the response body.

Note

Only the first 512 KB of the response body is read. If the response body is longer, it is truncated to 512KB.

The following table shows the possible response codes for this operation:

Response CodeNameDescription
200OKRequest completed.
400Bad requestThe system received an invalid value in a request.
401UnauthorizedThe system received a request from a user that is not authenticated.
403ForbiddenThe system received a request that the user is not authorized to make.
404Not FoundThe URL, entity, or account requested is not found in the system.
500Internal Server ErrorAn unexpected condition was encountered.
503Service UnavailableThe system is experiencing heavy load or another system failure.

Request

Example Test a check: JSON request

{
"type": "remote.http",
"details": {
"url": "http://www.foo.com",
"method": "GET"
},
"monitoring_zones_poll": [
"mzA"
],
"timeout": 30,
"target_alias": "default"
}

Response

Example Test check with debug: JSON response

[
{
"timestamp": 1319222001982,
"monitoring_zone_id": "mzxJ4L2IU",
"available": true,
"status": "code=200,rt=0.257s,bytes=0",
"metrics": {
"bytes": {
"type": "i",
"data": "0"
},
"tt_firstbyte": {
"type": "I",
"data": "257"
},
"tt_connect": {
"type": "I",
"data": "128"
},
"code": {
"type": "s",
"data": "200"
},
"duration": {
"type": "I",
"data": "257"
}
},
"debug_info": {
"body": "My shiny website"
}
}
]

Test an existing check

POST /entities/{entityId}/checks/{checkId}/test

Test an existing check inline.

This operation causes Rackspace Cloud Monitoring to attempt to run a duplicate check on the specified monitoring zones and return the results. This enables you to test the check parameters.

Note

This operation does NOT cause the already-created check to be run, but rather creates a duplicate check with the same parameters as the original, and performs the test using that. You can copy the results of a test check response and paste it directly into a test alarm.

There is no request body, just posting to the URL executes the request.

The following table shows the possible response codes for this operation:

Response CodeNameDescription
200OKRequest completed.
400Bad requestThe system received an invalid value in a request.
401UnauthorizedThe system received a request from a user that is not authenticated.
403ForbiddenThe system received a request that the user is not authorized to make.
404Not FoundThe URL, entity, or account requested is not found in the system.
500Internal Server ErrorAn unexpected condition was encountered.
503Service UnavailableThe system is experiencing heavy load or another system failure.

Request

The following table shows the header parameters for the request:

NameTypeDescription
X-Auth-TokenString (Required)A valid authentication token with administrative access. For details, see Get your credentials

Note

This operation does not accept a request body.

Response

Example Test existing check: JSON response

[
{
"timestamp": 1319222001982,
"monitoring_zone_id": "mzxJ4L2IU",
"available": true,
"status": "code=200,rt=0.257s,bytes=0",
"metrics": {
"bytes": {
"type": "i",
"data": "0"
},
"tt_firstbyte": {
"type": "I",
"data": "257"
},
"tt_connect": {
"type": "I",
"data": "128"
},
"code": {
"type": "s",
"data": "200"
},
"duration": {
"type": "I",
"data": "257"
}
}
}
]

List checks for an entity

GET /entities/{entityId}/checks

Lists the checks associated with a given entityId.

Use /checks?id=checkOneId & id=checkTwoId to filter the results to only include information about the specified checks.

This operation can be paginated. For information, see Paginated collections

The following table shows the possible response codes for this operation:

Response CodeNameDescription
200OKThe request completed.
401UnauthorizedThe system received a request from a user that is not authenticated.
403ForbiddenThe system received a request that the user is not authorized to make.
500Internal Server ErrorAn unexpected condition was encountered.
503Service UnavailableThe system is experiencing heavy load or another system failure.

Request

The following table shows the header parameters for the request:

NameTypeDescription
X-Auth-TokenString (Required)A valid authentication token with administrative access. For details, see Get your credentials

Note

This operation does not accept a request body.

Response

Example List checks for entity: JSON response

{
"values": [
{
"id": "chAAAA",
"label": "Website check 1",
"type": "remote.http",
"details": {
"url": "http://www.foo.com",
"method": "GET",
"follow_redirects": true,
"include_body": false
},
"monitoring_zones_poll": [
"mzA"
],
"timeout": 30,
"period": 100,
"target_alias": "entity_ip_addresses_hash_key"
}
],
"metadata": {
"count": 1,
"limit": 50,
"marker": null,
"next_marker": null,
"next_href": null
}
}

Get a check by ID

GET /entities/{entityId}/checks/{checkId}

Use this operation to retrieve the current state of a check.

The following table shows the possible response codes for this operation:

Response CodeNameDescription
200OKThe request completed.
401UnauthorizedThe system received a request from a user that is not authenticated.
403ForbiddenThe system received a request that the user is not authorized to make.
404Not FoundThe URL, entity, or account requested is not found in the system.
413Over LimitThe response body is too large.
500Internal Server ErrorAn unexpected condition was encountered.
503Service UnavailableThe system is experiencing heavy load or another system failure.

Request

The following table shows the header parameters for the request:

NameTypeDescription
X-Auth-TokenString (Required)A valid authentication token with administrative access. For details, see Get your credentials

Note

This operation does not accept a request body.

Response

Example Get check by ID: JSON response

{
"id": "chAAAA",
"label": "Website check 1",
"type": "remote.http",
"details": {
"url": "http://www.foo.com",
"method": "GET",
"follow_redirects": true,
"include_body": false
},
"monitoring_zones_poll": [
"mzA"
],
"timeout": 30,
"period": 100,
"target_alias": "entity_ip_addresses_hash_key"
}

Update a check by ID

PUT /entities/{entityId}/checks/{checkId}

Updates the specified check with the attribute values included in the request body. You only have to specify the attributes that you want to update. Refer to the Check attributes table.

The following table shows the possible response codes for this operation:

Response CodeNameDescription
204OKThe server has fulfilled the request but does not need to return an entity- body.
400Bad requestThe system received an invalid value in a request.
401UnauthorizedThe system received a request from a user that is not authenticated.
403ForbiddenThe system received a request that the user is not authorized to make.
404Not FoundThe URL, entity, or account requested is not found in the system.
500Internal Server ErrorAn unexpected condition was encountered.
503Service UnavailableThe system is experiencing heavy load or another system failure.

Request

The following table shows the header parameters for the request:

NameTypeDescription
X-Auth-TokenString (Required)A valid authentication token with administrative access. For details, see Get your credentials

Example Update check by ID: JSON request

{
"label": "New check label",
"timeout": 10
}

Response

This operation does not return a response body.

Delete a check by ID

DELETE /entities/{entityId}/checks/{checkId}

Deletes a check from your account.

The following table shows the possible response codes for this operation:

Response CodeNameDescription
204OKThe server has fulfilled the request. Does not return a response body.
401UnauthorizedThe system received a request from a user that is not authenticated.
403ForbiddenThe system received a request that the user is not authorized to make.
404Not FoundThe URL, entity, or account requested is not found in the system.
500Internal Server ErrorAn unexpected condition was encountered.
503Service UnavailableThe system is experiencing heavy load or another system failure.

Request

The following table shows the header parameters for the request:

NameTypeDescription
X-Auth-TokenString (Required)A valid authentication token with administrative access. For details, see Get your credentials

Note

This operation does not accept a request body.

Response

This operation does not return a response body.