Alert Rules¶
Overview¶
This document describes the API to define alert rules. This includes alert rules for auto-scaling and monitoring the health of the BIG-IP devices. This API can also be used to define alert rules for application health.
Requests¶
Examples¶
List a specific alert rule¶
GET https://192.0.2.242/mgmt/cm/shared/policymgmt/alert-rules/<name>
Response¶
HTTP/1.1 200 OK
{
"name": "my-device-health-rule",
"description": "Device health rules for devices in Data Center 1",
"alertTypeId": "device-health",
"isDefault": false,
"producerType": "device",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "device-cpu",
"alertRuleType": "nested-metric",
"warningThreshold": 60,
"errorThreshold": 80,
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"unit": "percent",
"operator": "greater-than",
"enabled": true
}],
"alertRuleReferences": [{
"name": "custom-health-rule-dc2",
"link": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/custom-health-rule-dc2",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"applicationReferences": [{
"name": "app1",
"link": "https://configuration/app1",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceReferences": [{
"name": "bigip1.mgmt.foo.bar.com",
"link": "https://configuration/device/uri",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"ssgReferences": [{
"name": "ssg1",
"link": "https://localhost/mgmt/cm/cloud/service-scaling-groups/9aa32232-2d42-4df3-4d33-sdc2313454fb",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceGroupReferences": [{
"name": No example value specified,
"link": No example value specified,
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"alertRuleType": "metric",
"warningThreshold": -1.0,
"errorThreshold": 0.1,
"unit": "percent",
"operator": "greater-than",
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"enabled": true,
"isPublic": true
}
List all alert rules¶
GET https://192.0.2.242/mgmt/cm/shared/policymgmt/alert-rules
Response¶
HTTP/1.1 200 OK
{
"name": "my-device-health-rule",
"description": "Device health rules for devices in Data Center 1",
"alertTypeId": "device-health",
"isDefault": false,
"producerType": "device",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "device-cpu",
"alertRuleType": "nested-metric",
"warningThreshold": 60,
"errorThreshold": 80,
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"unit": "percent",
"operator": "greater-than",
"enabled": true
}],
"alertRuleReferences": [{
"name": "custom-health-rule-dc2",
"link": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/custom-health-rule-dc2",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"applicationReferences": [{
"name": "app1",
"link": "https://configuration/app1",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceReferences": [{
"name": "bigip1.mgmt.foo.bar.com",
"link": "https://configuration/device/uri",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"ssgReferences": [{
"name": "ssg1",
"link": "https://localhost/mgmt/cm/cloud/service-scaling-groups/9aa32232-2d42-4df3-4d33-sdc2313454fb",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceGroupReferences": [{
"name": No example value specified,
"link": No example value specified,
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"alertRuleType": "metric",
"warningThreshold": -1.0,
"errorThreshold": 0.1,
"unit": "percent",
"operator": "greater-than",
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"enabled": true,
"isPublic": true
}
POST to create an alert rule¶
POST https://192.0.2.242/mgmt/cm/shared/policymgmt/alert-rules
The Json in the body of the request can look similar to the following example.
{
"name": "my-device-health-rule",
"description": "Device health rules for devices in Data Center 1",
"alertTypeId": "device-health",
"isDefault": false,
"producerType": "device",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "device-cpu",
"alertRuleType": "nested-metric",
"warningThreshold": 60,
"errorThreshold": 80,
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"unit": "percent",
"operator": "greater-than",
"enabled": true
}],
"alertRuleReferences": [{
"name": "custom-health-rule-dc2",
"link": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/custom-health-rule-dc2",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"applicationReferences": [{
"name": "app1",
"link": "https://configuration/app1",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceReferences": [{
"name": "bigip1.mgmt.foo.bar.com",
"link": "https://configuration/device/uri",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"ssgReferences": [{
"name": "ssg1",
"link": "https://localhost/mgmt/cm/cloud/service-scaling-groups/9aa32232-2d42-4df3-4d33-sdc2313454fb",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceGroupReferences": [{
"name": No example value specified,
"link": No example value specified,
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"alertRuleType": "metric",
"warningThreshold": -1.0,
"errorThreshold": 0.1,
"unit": "percent",
"operator": "greater-than",
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"enabled": true,
"isPublic": true
}
Response¶
HTTP/1.1 200 OK
{
"name": "my-device-health-rule",
"description": "Device health rules for devices in Data Center 1",
"alertTypeId": "device-health",
"isDefault": false,
"producerType": "device",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "device-cpu",
"alertRuleType": "nested-metric",
"warningThreshold": 60,
"errorThreshold": 80,
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"unit": "percent",
"operator": "greater-than",
"enabled": true
}],
"alertRuleReferences": [{
"name": "custom-health-rule-dc2",
"link": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/custom-health-rule-dc2",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"applicationReferences": [{
"name": "app1",
"link": "https://configuration/app1",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceReferences": [{
"name": "bigip1.mgmt.foo.bar.com",
"link": "https://configuration/device/uri",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"ssgReferences": [{
"name": "ssg1",
"link": "https://localhost/mgmt/cm/cloud/service-scaling-groups/9aa32232-2d42-4df3-4d33-sdc2313454fb",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceGroupReferences": [{
"name": No example value specified,
"link": No example value specified,
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"alertRuleType": "metric",
"warningThreshold": -1.0,
"errorThreshold": 0.1,
"unit": "percent",
"operator": "greater-than",
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"enabled": true,
"isPublic": true
}
PATCH to edit an alert rule¶
PATCH https://192.0.2.242/mgmt/cm/shared/policymgmt/alert-rules/<name>
The Json in the body of the request can look similar to the following example.
{
"description": "Device health rules for devices in Data Center 1",
"alertTypeId": "device-health",
"isDefault": false,
"producerType": "device",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "device-cpu",
"alertRuleType": "nested-metric",
"warningThreshold": 60,
"errorThreshold": 80,
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"unit": "percent",
"operator": "greater-than",
"enabled": true
}],
"alertRuleReferences": [{
"name": "custom-health-rule-dc2",
"link": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/custom-health-rule-dc2",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"applicationReferences": [{
"name": "app1",
"link": "https://configuration/app1",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceReferences": [{
"name": "bigip1.mgmt.foo.bar.com",
"link": "https://configuration/device/uri",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"ssgReferences": [{
"name": "ssg1",
"link": "https://localhost/mgmt/cm/cloud/service-scaling-groups/9aa32232-2d42-4df3-4d33-sdc2313454fb",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceGroupReferences": [{
"name": No example value specified,
"link": No example value specified,
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"alertRuleType": "metric",
"warningThreshold": -1.0,
"errorThreshold": 0.1,
"unit": "percent",
"operator": "greater-than",
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"enabled": true,
"isPublic": true
}
Response¶
HTTP/1.1 200 OK
{
"name": "my-device-health-rule",
"description": "Device health rules for devices in Data Center 1",
"alertTypeId": "device-health",
"isDefault": false,
"producerType": "device",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "device-cpu",
"alertRuleType": "nested-metric",
"warningThreshold": 60,
"errorThreshold": 80,
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"unit": "percent",
"operator": "greater-than",
"enabled": true
}],
"alertRuleReferences": [{
"name": "custom-health-rule-dc2",
"link": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/custom-health-rule-dc2",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"applicationReferences": [{
"name": "app1",
"link": "https://configuration/app1",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceReferences": [{
"name": "bigip1.mgmt.foo.bar.com",
"link": "https://configuration/device/uri",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"ssgReferences": [{
"name": "ssg1",
"link": "https://localhost/mgmt/cm/cloud/service-scaling-groups/9aa32232-2d42-4df3-4d33-sdc2313454fb",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceGroupReferences": [{
"name": No example value specified,
"link": No example value specified,
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"alertRuleType": "metric",
"warningThreshold": -1.0,
"errorThreshold": 0.1,
"unit": "percent",
"operator": "greater-than",
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"enabled": true,
"isPublic": true
}
DELETE an alert rule¶
DELETE https://192.0.2.242/mgmt/cm/shared/policymgmt/alert-rules/<name>
Response¶
HTTP/1.1 200 OK
{
"name": "my-device-health-rule",
"description": "Device health rules for devices in Data Center 1",
"alertTypeId": "device-health",
"isDefault": false,
"producerType": "device",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "device-cpu",
"alertRuleType": "nested-metric",
"warningThreshold": 60,
"errorThreshold": 80,
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"unit": "percent",
"operator": "greater-than",
"enabled": true
}],
"alertRuleReferences": [{
"name": "custom-health-rule-dc2",
"link": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/custom-health-rule-dc2",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"applicationReferences": [{
"name": "app1",
"link": "https://configuration/app1",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceReferences": [{
"name": "bigip1.mgmt.foo.bar.com",
"link": "https://configuration/device/uri",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"ssgReferences": [{
"name": "ssg1",
"link": "https://localhost/mgmt/cm/cloud/service-scaling-groups/9aa32232-2d42-4df3-4d33-sdc2313454fb",
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"deviceGroupReferences": [{
"name": No example value specified,
"link": No example value specified,
"filter": {
"field": No example value specified,
"value": No example value specified
}
}],
"alertRuleType": "metric",
"warningThreshold": -1.0,
"errorThreshold": 0.1,
"unit": "percent",
"operator": "greater-than",
"observation": 1440,
"referenceObservation": 10080,
"errorDelta": 3,
"enabled": true,
"isPublic": true
}
PATCH to define an application alert rule¶
The following example shows how an alert rule can be defined for an application.
PATCH https://192.0.2.242/mgmt/cm/shared/policymgmt/alert-rules/site36.example.com-health
The Json in the body of the request can look similar to the following example.
{
"description": "Health rule for app1",
"alertTypeId": "application-health",
"isDefault": false,
"producerType": "application",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "application-response-time",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "ms",
"operator": "greater-than",
"enabled": false
},
{
"alertTypeId": "server-side-rtt",
"alertRuleType": "nested-metric",
"warningThreshold": 20,
"errorThreshold": 150,
"unit": "ms",
"operator": "greater-than",
"enabled": true
},
{
"alertTypeId": "client-side-rtt",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "ms",
"operator": "greater-than",
"enabled": false
},
{
"alertTypeId": "incomplete-transactions",
"alertRuleType": "nested-metric",
"warningThreshold": 1,
"errorThreshold": 10,
"unit": "percent",
"operator": "greater-than",
"enabled": true
},
{
"alertTypeId": "server-errors",
"alertRuleType": "nested-metric",
"warningThreshold": 0.1,
"errorThreshold": 0.5,
"unit": "percent",
"operator": "greater-than",
"enabled": true
},
{
"alertTypeId": "request-errors",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "percent",
"operator": "greater-than",
"enabled": false
},
{
"alertTypeId": "virtual-server-status",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0.99,
"observation": 120,
"unit": "percent",
"operator": "greater-than",
"enabled": true
},
{
"alertTypeId": "high-tps",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "tps",
"operator": "greater-than",
"enabled": false
},
{
"alertTypeId": "low-tps",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "tps",
"operator": "less-than",
"enabled": false
}
],
"applicationReferences": [{
"name": "app1",
"link": "https://localhost/mgmt/cm/global/config-sets/4b7519d2-f08d-355c-9cfa-869b76c7e7ce"
}],
"alertRuleType": "aggregated",
"isPublic": true,
"kind": "cm:shared:policymgmt:alert-rules:alertrulestate",
"selfLink": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/dosAppAppService-health"
}
Response¶
The Json in the body of the response can look similar to the following.
HTTP/1.1 200 OK
{
"name": "app1-health",
"description": "Health rule for app1",
"alertTypeId": "application-health",
"isDefault": false,
"producerType": "application",
"alertType": "active",
"alertContext": "health",
"includeInternalAlerts": true,
"aggregationMethod": "or",
"external": false,
"nestedRules": [{
"alertTypeId": "application-response-time",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "ms",
"operator": "greater-than",
"enabled": false
},
{
"alertTypeId": "server-side-rtt",
"alertRuleType": "nested-metric",
"warningThreshold": 20,
"errorThreshold": 150,
"unit": "ms",
"operator": "greater-than",
"enabled": true
},
{
"alertTypeId": "client-side-rtt",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "ms",
"operator": "greater-than",
"enabled": false
},
{
"alertTypeId": "incomplete-transactions",
"alertRuleType": "nested-metric",
"warningThreshold": 1,
"errorThreshold": 10,
"unit": "percent",
"operator": "greater-than",
"enabled": true
},
{
"alertTypeId": "server-errors",
"alertRuleType": "nested-metric",
"warningThreshold": 0.1,
"errorThreshold": 0.5,
"unit": "percent",
"operator": "greater-than",
"enabled": true
},
{
"alertTypeId": "request-errors",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "percent",
"operator": "greater-than",
"enabled": false
},
{
"alertTypeId": "virtual-server-status",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0.99,
"observation": 120,
"unit": "percent",
"operator": "greater-than",
"enabled": true
},
{
"alertTypeId": "high-tps",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "tps",
"operator": "greater-than",
"enabled": false
},
{
"alertTypeId": "low-tps",
"alertRuleType": "nested-metric",
"warningThreshold": 0,
"errorThreshold": 0,
"unit": "tps",
"operator": "less-than",
"enabled": false
}
],
"applicationReferences": [{
"name": "app1",
"link": "https://localhost/mgmt/cm/global/config-sets/4b7519d2-f08d-355c-9cfa-869b76c7e7ce"
}],
"alertRuleType": "aggregated",
"isPublic": true,
"generation": 2,
"lastUpdateMicros": 1563972881176455,
"kind": "cm:shared:policymgmt:alert-rules:alertrulestate",
"selfLink": "https://localhost/mgmt/cm/shared/policymgmt/alert-rules/dosAppAppService-health"
}