Skip to content
This repository was archived by the owner on Aug 16, 2022. It is now read-only.

Commit 54e1d0f

Browse files
Merge pull request #13 from opendistro/master
merge
2 parents 1be9a82 + f5ed211 commit 54e1d0f

File tree

15 files changed

+284
-95
lines changed

15 files changed

+284
-95
lines changed

docs/alerting/api.md

Lines changed: 100 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
layout: default
33
title: API
44
parent: Alerting
5-
nav_order: 3
5+
nav_order: 15
66
---
77

88
# Alerting API
@@ -829,6 +829,96 @@ PUT _opendistro/_alerting/destinations/<destination-id>
829829
```
830830

831831

832+
---
833+
834+
## Get destination
835+
836+
Retrieve one destination.
837+
838+
#### Requests
839+
840+
```json
841+
GET _opendistro/_alerting/destinations/<destination-id>
842+
```
843+
844+
#### Sample response
845+
846+
```json
847+
{
848+
"totalDestinations": 1,
849+
"destinations": [{
850+
"id": "1a2a3a4a5a6a7a",
851+
"type": "slack",
852+
"name": "sample-destination",
853+
"user": {
854+
"name": "psantos",
855+
"backend_roles": [
856+
"human-resources"
857+
],
858+
"roles": [
859+
"alerting_full_access",
860+
"hr-role"
861+
],
862+
"custom_attribute_names": []
863+
},
864+
"schema_version": 3,
865+
"seq_no": 0,
866+
"primary_term": 6,
867+
"last_update_time": 1603943261722,
868+
"slack": {
869+
"url": "https://example.com"
870+
}
871+
}
872+
]
873+
}
874+
```
875+
876+
877+
---
878+
879+
## Get destinations
880+
881+
Retrieve all destinations.
882+
883+
#### Requests
884+
885+
```json
886+
GET _opendistro/_alerting/destinations
887+
```
888+
889+
#### Sample response
890+
891+
```json
892+
{
893+
"totalDestinations": 1,
894+
"destinations": [{
895+
"id": "1a2a3a4a5a6a7a",
896+
"type": "slack",
897+
"name": "sample-destination",
898+
"user": {
899+
"name": "psantos",
900+
"backend_roles": [
901+
"human-resources"
902+
],
903+
"roles": [
904+
"alerting_full_access",
905+
"hr-role"
906+
],
907+
"custom_attribute_names": []
908+
},
909+
"schema_version": 3,
910+
"seq_no": 0,
911+
"primary_term": 6,
912+
"last_update_time": 1603943261722,
913+
"slack": {
914+
"url": "https://example.com"
915+
}
916+
}
917+
]
918+
}
919+
```
920+
921+
832922
---
833923

834924
## Delete destination
@@ -904,7 +994,7 @@ PUT _opendistro/_alerting/destinations/email_accounts/<email_account_id>
904994
"port": 465,
905995
"method": "ssl"
906996
}
907-
```
997+
```
908998
#### Sample response
909999
```json
9101000
{
@@ -1045,7 +1135,7 @@ POST _opendistro/_alerting/destinations/email_accounts/_search
10451135
```
10461136

10471137
---
1048-
1138+
10491139
## Create email group
10501140

10511141
#### Request
@@ -1056,7 +1146,7 @@ POST _opendistro/_alerting/destinations/email_groups
10561146
"name": "example_email_group",
10571147
"emails": [{
10581148
"email": "[email protected]"
1059-
}]
1149+
}]
10601150
}
10611151
```
10621152

@@ -1090,7 +1180,7 @@ PUT _opendistro/_alerting/destinations/email_groups/<email_group_id>
10901180
"name": "example_email_group",
10911181
"emails": [{
10921182
"email": "[email protected]"
1093-
}]
1183+
}]
10941184
}
10951185
```
10961186
#### Sample response
@@ -1112,7 +1202,7 @@ PUT _opendistro/_alerting/destinations/email_groups/<email_group_id>
11121202
}
11131203
}
11141204
```
1115-
1205+
11161206
## Get email group
11171207

11181208
#### Request
@@ -1122,7 +1212,7 @@ GET _opendistro/_alerting/destinations/email_groups/<email_group_id>
11221212
"name": "example_email_group",
11231213
"emails": [{
11241214
"email": "[email protected]"
1125-
}]
1215+
}]
11261216
}
11271217
```
11281218
#### Sample response
@@ -1144,7 +1234,7 @@ GET _opendistro/_alerting/destinations/email_groups/<email_group_id>
11441234
}
11451235
}
11461236
```
1147-
1237+
11481238
## Delete email group
11491239

11501240
#### Request
@@ -1170,7 +1260,7 @@ DELETE _opendistro/_alerting/destinations/email_groups/<email_group_id>
11701260
"_primary_term" : 2
11711261
}
11721262
```
1173-
1263+
11741264
## Search email group
11751265

11761266
#### Request
@@ -1235,4 +1325,4 @@ POST _opendistro/_alerting/destinations/email_groups/_search
12351325
}
12361326
}
12371327
```
1238-
---
1328+
---

docs/alerting/cron.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
layout: default
33
title: Cron
4-
nav_order: 5
4+
nav_order: 20
55
parent: Alerting
66
has_children: false
77
---

docs/alerting/monitors.md

Lines changed: 34 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -32,64 +32,69 @@ Destination | A reusable location for an action, such as Amazon Chime, Slack, or
3232

3333
1. Choose **Alerting**, **Destinations**, **Add destination**.
3434
1. Specify a name for the destination so that you can identify it later.
35-
1. For **Type**, choose Slack, Amazon Chime, custom webhook, or [email](#email-as-a-destination).
35+
1. For **Type**, choose Slack, Amazon Chime, custom webhook, or [email](#email-as-a-destination).
3636

3737
For Email type, refer to [Email as a destination](#email-as-a-destination) section below. For all other types, specify the webhook URL. For more information about webhooks, see the documentation for [Slack](https://api.slack.com/incoming-webhooks) and [Chime](https://docs.aws.amazon.com/chime/latest/ug/webhooks.html).
3838

3939
For custom webhooks, you must specify more information: parameters and headers. For example, if your endpoint requires basic authentication, you might need to add a header with a key of `Authorization` and a value of `Basic <Base64-encoded-credential-string>`. You might also need to change `Content-Type` to whatever your webhook requires. Popular values are `application/json`, `application/xml`, and `text/plain`.
4040

4141
This information is stored in plain text in the Elasticsearch cluster. We will improve this design in the future, but for now, the encoded credentials (which are neither encrypted nor hashed) might be visible to other Elasticsearch users.
4242

43+
4344
### Email as a destination
44-
To send or receive an alert notification as an email, first select **Email** as the destination **Type** for the alert. Next, you must add at least one sender and a recipient. We also recommend adding email groups if you want to notify more than a few people of an alert. You can configure senders and recipients using **Manage senders** and **Manage email groups**.
45+
46+
To send or receive an alert notification as an email, choose **Email** as the destination type. Next, add at least one sender and recipient. We recommend adding email groups if you want to notify more than a few people of an alert. You can configure senders and recipients using **Manage senders** and **Manage email groups**.
47+
4548

4649
#### Manage senders
47-
Manage senders allows you to configure and manage **Sender** email addresses. Senders are email accounts from where the alert notification is sent to different recipients or email groups.
50+
51+
Senders are email accounts from which the alerting plugin sends notifications.
4852

4953
To configure a sender email, do the following:
5054

51-
1. Once you choose **Email** as the destination **Type**, choose **Manage senders**, under **Settings**. You can also do this using the **Actions** button on the top right of the **Destinations** page.
52-
1. In the **Manage email senders** modal window, choose **Add sender**, **New sender**. Multiple senders can be added one at a time.
53-
1. Enter a unique **Sender name**.
54-
1. Enter the **Email address**, SMTP **Host** (e.g. `smtp.gmail.com` for a Gmail account), and the **Port** number.
55-
1. You can choose to use an **Encryption method** or leave it as **None**. However, most email providers require SSL or TLS and this requires you to add a username and password to the Elasticsearch keystore. Refer to [Authenticate sender account](#authenticate-sender-account) to learn more.
56-
1. Choose **Save** to save the configuration and create the sender. You can create a sender even before you enter your credentials for SSL or TLS. However, you must [authenticate each sender account](#authenticate-sender-account) with credentials before you use the destination to send your alert.
55+
1. After you choose **Email** as the destination type, choose **Manage senders**.
56+
1. Choose **Add sender**, **New sender** and enter a unique name.
57+
1. Enter the email address, SMTP host (e.g. `smtp.gmail.com` for a Gmail account), and the port.
58+
1. Choose an encryption method, or use the default value of **None**. However, most email providers require SSL or TLS, which requires a username and password in Elasticsearch keystore. Refer to [Authenticate sender account](#authenticate-sender-account) to learn more.
59+
1. Choose **Save** to save the configuration and create the sender. You can create a sender even before you add your credentials to the Elasticsearch keystore. However, you must [authenticate each sender account](#authenticate-sender-account) before you use the destination to send your alert.
60+
61+
You can reuse senders across many different destinations, but each destination only supports one sender.
62+
5763

58-
Once the sender is created, the sender account is available to be selected when creating an email destination. You can reuse senders across many different destinations, but each destination only supports one sender.
64+
#### Manage email groups or recipients
5965

60-
#### Manage email groups or recipients
61-
Use email groups to create and manage reusable lists of email addresses. For example, one alert might email the DevOps team, whereas another might email the DevOps team and the engineering team.
66+
Use email groups to create and manage reusable lists of email addresses. For example, one alert might email the DevOps team, whereas another might email the executive team and the engineering team.
6267

63-
You can enter individual email addresses, or an email group in the **Recipients** field. For email groups, you can pre-create a group using **Manage email groups**.
68+
You can enter individual email addresses or an email group in the **Recipients** field.
6469

65-
To create and manage email groups, do the following:
66-
1. Once you select **Email** as the destination **Type**, choose **Manage email groups**, under **Settings**. Then choose **Add email group**, **New email group**. You can also do this using the **Actions** button on the top right of the **Destinations** page.
67-
1. Enter a unique **Email group name**.
68-
1. For recipient emails, enter any number of email addresses.
70+
1. After you choose **Email** as the destination type, choose **Manage email groups**. Then choose **Add email group**, **New email group**.
71+
1. Enter a unique name.
72+
1. For recipient emails, enter any number of email addresses.
6973
1. Choose **Save**.
7074

71-
You can view the list of all email destinations you created on the **Destinations** landing page. The **Actions** button on the top right of the **Destinations** page allows you to mange email senders and email groups from this page.
7275

7376
#### Authenticate sender account
7477

75-
You must authenticate each sender account with credentials before you send an alert notification from that account to recipients or email groups. You can enter these credentials in the Elasticsearch keystore using the CLI. Run the following commands (in your Elasticsearch directory) to enter your username and password. The `<sender_name>` is the name you entered for **Sender**.
78+
If your email provider requires SSL or TLS, you must authenticate each sender account before you can send an email. Enter these credentials in the Elasticsearch keystore using the CLI. Run the following commands (in your Elasticsearch directory) to enter your username and password. The `<sender_name>` is the name you entered for **Sender** earlier.
7679

7780
```bash
78-
./bin/elasticsearch-keystore add opendistro.alerting.destination.email.<sender_name>.username
81+
./bin/elasticsearch-keystore add opendistro.alerting.destination.email.<sender_name>.username
7982
./bin/elasticsearch-keystore add opendistro.alerting.destination.email.<sender_name>.password
8083
```
8184

82-
**Note**: The keystore settings are node-specific. You must run these commands on each node.
85+
**Note**: Keystore settings are node-specific. You must run these commands on each node.
8386
{: .note}
8487

85-
To change or update your credentials (once you've added them in the keystore settings for every node), you can call the reload API to ensure that your new changes are automatically updated on every node. Run this command to call the reload API:
88+
To change or update your credentials (after you've added them to the keystore on every node), call the reload API to automatically update those credentials without restarting Elasticsearch:
89+
8690
```json
87-
POST _nodes/reload_secure_settings
91+
POST _nodes/reload_secure_settings
8892
{
89-
"secure_settings_password": "1234"
93+
"secure_settings_password": "1234"
9094
}
9195
```
9296

97+
9398
---
9499

95100
## Create monitors
@@ -98,7 +103,7 @@ POST _nodes/reload_secure_settings
98103
1. Specify a name and schedule for the monitor.
99104

100105
The anomaly detection option is for pairing with the anomaly detection plugin. See [Anomaly Detection](../../ad/).
101-
For anomaly detector, choose an appropriate schedule for the monitor based on the detector interval. Otherwise, the alerting monitor may miss reading the results.
106+
For anomaly detector, choose an appropriate schedule for the monitor based on the detector interval. Otherwise, the alerting monitor might miss reading the results.
102107

103108
For example, assume you set the monitor interval and the detector interval as 5 minutes, and you start the detector at 12:00. If an anomaly is detected at 12:05, it might be available at 12:06 because of the delay between writing the anomaly and it being available for queries. The monitor reads the anomaly results between 12:00 and 12:05, so it does not get the anomaly results available at 12:06.
104109

@@ -108,6 +113,9 @@ When you create a monitor using Kibana, the anomaly detector plugin generates a
108113
Whenever you update a detector’s interval, make sure to update the associated monitor interval as well, as the anomaly detection plugin does not do this automatically.
109114

110115
1. Choose one or more indices. You can also use `*` as a wildcard to specify an index pattern.
116+
117+
If you use the security plugin, you can only choose indices that you have permission to access. For details, see [Alerting security](../security/).
118+
111119
1. Define the monitor in one of three ways: visually, using a query, or using an anomaly detector.
112120

113121
- Visual definition works well for monitors that you can define as "some value is above or below some threshold for some amount of time."
@@ -200,6 +208,7 @@ A return value of true means the trigger condition has been met, and the trigger
200208
The **Info** link next to **Trigger condition** contains a useful summary of the variables and results available to your query.
201209
{: .tip }
202210

211+
203212
### Anomaly detector
204213

205214
For **Trigger type**, choose **Anomaly detector grade and confidence**.

docs/alerting/security-roles.md

Lines changed: 0 additions & 48 deletions
This file was deleted.

0 commit comments

Comments
 (0)