Returns a list of alert rules configured under your ThousandEyes account, specifically limited to alert rules for Cloud and Enterprise agents, and BGP routing. Alert rules for Endpoint Agents, Devices, and Internet Insights are not included in the results.

Optional (Querystring) Parameters

Request

Example

$ curl https://api.thousandeyes.com/v6/alert-rules.json \ -u {email}:{authToken}

Response

Sends back an array of alert rules, indicating ruleID, whether or not the alert is enabled, recipient lists, and the rule criteria and clearing logic. Default rules for each type are indicated with a bit response (1 or 0); default alert rules are assigned by default to each type of test to which they apply.

FieldData TypeUnitsNotes
ruleIdintegern/aunique ID of the alert rule
ruleNamestringn/aname of the alert rule
expressionstringn/astring expression of alert rule
directionstringn/aoptional field with one of the following values: TO_TARGET, FROM_TARGET, BIDIRECTIONAL, for applicable alert types (eg. path trace, End-to-End (Agent) etc.)
notifyOnClearbooleann/a1 to send notification when alert clears
defaultbooleann/aAlert rules allow up to 1 alert rule to be selected as a default for each type. By checking the default option, this alert rule will be automatically included on subsequently created tests that test a metric used in alerting here
alertTypestringn/atype of alert rule, as determined by metric selection
minimumSourcesintegern/athe minimum number of agents or monitors that must meet the specified criteria in order to trigger the alert
minimumSourcesPctintegern/athe minimum percentage of all assigned agents or monitors that must meet the specified criteria in order to trigger the alert
roundsViolatingModestringn/aEXACT requires that the same agent(s) meet the threshold in consecutive rounds; default is ANY
roundsViolatingOutOfintegern/aapplies to only v6 and higher, specifies the divisor (y value) for the “X of Y times” condition.
roundsViolatingRequiredintegern/aapplies to only v6 and higher, specifies the numerator (x value) for the “X of Y times” condition
severitystringn/afield with one of the following values: INFO, MAJOR, MINOR, CRITICAL for all alert types

HTTP/1.1 200 OK Server: nginx Date: Mon, 09 May 2016 16:04:24 GMT Content-Type: application/json;charset=UTF-8 Transfer-Encoding: chunked Connection: keep-alive Cache-Control: no-store X-Organization-Rate-Limit-Limit: 240 X-Organization-Rate-Limit-Remaining: 228 X-Organization-Rate-Limit-Reset: 1493373360 Strict-Transport-Security: max-age=31536000 X-Server-Name: 1-1

Body

{ "alertRules": [ { "alertType": "Path Trace", "default": 0, "expression": "((hops((hopDelay >= 100 ms))))", "minimumSources": 1, "notifyOnClear": 1, "roundsViolatingOutOf": 10, "roundsViolatingRequired": 9, "ruleId": 99453, "ruleName": "The End of the Internet", "severity": "INFO" }, { "alertType": "HTTP Server", "default": 0, "expression": "((errorType != \"None\"))", "minimumSourcesPct": 30, "notifyOnClear": 1, "roundsViolatingOutOf": 1, "roundsViolatingRequired": 1, "ruleId": 127094, "ruleName": "The End of the World", "severity": "CRITICAL" } ] }

For error responses, see the response status codes documentation.