Skip to content

Commit ecb6075

Browse files
committed
Add agent status alert rules
1 parent 2761548 commit ecb6075

File tree

4 files changed

+103
-1
lines changed

4 files changed

+103
-1
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"id": "elastic-agent-offline-status",
3+
"type": "alerting_rule_template",
4+
"attributes": {
5+
"name": "[Elastic Agent] Offline status",
6+
"tags": ["Elastic Agent"],
7+
"ruleTypeId": ".es-query",
8+
"schedule": {
9+
"interval": "1m"
10+
},
11+
"params": {
12+
"searchType": "esqlQuery",
13+
"timeWindowSize": 5,
14+
"timeWindowUnit": "m",
15+
"threshold": [0],
16+
"thresholdComparator": ">",
17+
"size": 100,
18+
"esqlQuery": {
19+
"esql": "FROM logs-elastic_agent.status_change-default, *:logs-elastic_agent.status_change-default\n| WHERE data_stream.dataset == \"elastic_agent.status_change\" and agentless == false and health_status == \"offline\""
20+
},
21+
"aggType": "count",
22+
"groupBy": "row",
23+
"termSize": 5,
24+
"sourceFields": [],
25+
"timeField": "@timestamp",
26+
"excludeHitsFromPreviousRun": true
27+
},
28+
"alertDelay": {
29+
"active": 1
30+
}
31+
},
32+
"coreMigrationVersion": "8.8.0",
33+
"typeMigrationVersion": "10.1.0"
34+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"id": "elastic-agent-unenrolled-status",
3+
"type": "alerting_rule_template",
4+
"attributes": {
5+
"name": "[Elastic Agent] Unenrolled status",
6+
"tags": ["Elastic Agent"],
7+
"ruleTypeId": ".es-query",
8+
"schedule": {
9+
"interval": "1m"
10+
},
11+
"params": {
12+
"searchType": "esqlQuery",
13+
"timeWindowSize": 5,
14+
"timeWindowUnit": "m",
15+
"threshold": [0],
16+
"thresholdComparator": ">",
17+
"size": 100,
18+
"esqlQuery": {
19+
"esql": "FROM logs-elastic_agent.status_change-default, *:logs-elastic_agent.status_change-default\n| WHERE data_stream.dataset == \"elastic_agent.status_change\" and agentless == false and health_status == \"unenrolled\""
20+
},
21+
"aggType": "count",
22+
"groupBy": "row",
23+
"termSize": 5,
24+
"sourceFields": [],
25+
"timeField": "@timestamp",
26+
"excludeHitsFromPreviousRun": true
27+
},
28+
"alertDelay": {
29+
"active": 1
30+
}
31+
},
32+
"coreMigrationVersion": "8.8.0",
33+
"typeMigrationVersion": "10.1.0"
34+
}

packages/elastic_agent/kibana/alerting_rule_template/elastic-agent-unhealthy-status.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
"thresholdComparator": ">",
1717
"size": 100,
1818
"esqlQuery": {
19-
"esql": "FROM logs-elastic_agent.status_change-default, *:logs-elastic_agent.status_change-default\n| WHERE data_stream.dataset == \"elastic_agent.status_change\" and agentless == false and status in (\"error\", \"degraded\")"
19+
"esql": "FROM logs-elastic_agent.status_change-default, *:logs-elastic_agent.status_change-default\n| WHERE data_stream.dataset == \"elastic_agent.status_change\" and agentless == false and health_status == \"unhealthy\""
2020
},
2121
"aggType": "count",
2222
"groupBy": "row",
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
{
2+
"id": "elastic-agent-uninstalled-status",
3+
"type": "alerting_rule_template",
4+
"attributes": {
5+
"name": "[Elastic Agent] Uninstalled status",
6+
"tags": ["Elastic Agent"],
7+
"ruleTypeId": ".es-query",
8+
"schedule": {
9+
"interval": "1m"
10+
},
11+
"params": {
12+
"searchType": "esqlQuery",
13+
"timeWindowSize": 5,
14+
"timeWindowUnit": "m",
15+
"threshold": [0],
16+
"thresholdComparator": ">",
17+
"size": 100,
18+
"esqlQuery": {
19+
"esql": "FROM logs-elastic_agent.status_change-default, *:logs-elastic_agent.status_change-default\n| WHERE data_stream.dataset == \"elastic_agent.status_change\" and agentless == false and health_status == \"uninstalled\""
20+
},
21+
"aggType": "count",
22+
"groupBy": "row",
23+
"termSize": 5,
24+
"sourceFields": [],
25+
"timeField": "@timestamp",
26+
"excludeHitsFromPreviousRun": true
27+
},
28+
"alertDelay": {
29+
"active": 1
30+
}
31+
},
32+
"coreMigrationVersion": "8.8.0",
33+
"typeMigrationVersion": "10.1.0"
34+
}

0 commit comments

Comments
 (0)