./add-alerting-target.sh [options]
Option | Description |
---|---|
--help | Display help message. |
--type <smtp|webhook> | Type of alerting target. Required: Yes |
--name <name> | Name for the alerting target. Essentially, this is a user-assigned label for the target. It must be unique. Required: Yes |
--alertgroup <device|service|both> | Filter alerts by alert group. Default: both |
--group-by <label1,label2,...> | Labels by which to group alerts. See below for the list of possible labels. For example:
Default: ... (all labels) |
--group-wait <duration> | How long to wait before sending the initial notification. Default: 30s |
--group-interval <duration> | How long to wait before sending an updated notification. Default: 5m |
--repeat-interval <duration> | How long to wait before repeating the last notification. Default: 4h |
--matchers '<matcher1,matcher2,matcherN>' | Alert label matchers in the format “name=value” or “name!=value”. There can be multiple matchers delimited by commas. |
Syntax | Example | Description |
---|---|---|
labelname=value | app=Device | Exact match. |
labelname!=value | app!=Device | Negative match (not match). |
labelname=~value | app=~Dev 'app=~Dev,metric=~Power' | Regex match (golanguage implementation of regex). The first example, matches reader alerts. The second example matches reader power alerts. |
labelname!~value | app!~Dev 'app!~Dev,metric!~Power' | Regex not match (golanguage implementation of regex). The first example, matches anything except reader alerts. The second example matches anything except reader power alerts. |
Label | Description |
---|---|
metric | The name of the alert. |
app | The type of entity that threw the alert. Possible values:
|
alertgroup | The category of alert. Possible values:
|
description | Brief description of the alert. |
resource | Unique identifier that threw the alert. Possible values:
|
severity | Severity of the alert. Possible values:
|
Option | Description |
---|---|
--smtp-from <email> | Sender email address. Required: Yes |
--smtp-to <email> | Recipient email address. You can only specify one address. To send to multiple addresses, repeat the add-alerting-target command using a different address and name.Required: Yes |
--smtp-smarthost <host:port> | SMTP server host and port. Required: Yes |
--smtp-auth-username <username> | SMTP authentication username. |
--smtp-auth-password <password> | SMTP authentication password. |
--smtp-require-tls <true|false> | Whether to require TLS. Default: true |
--smtp-hello <hostname> | The hostname to identify to the SMTP server. |
Option | Description |
---|---|
--webhook-url <url> | The URL to which to send HTTP POST requests. Required: Yes |
--webhook-max-alerts <number> | Maximum number of alerts to be sent per webhook message. Default: 0 (all alerts) |
--webhook-authorization-type <basic|bearer|none> | Type of authorization to use for webhook requests. none performs no authorization.Default: none |
--webhook-basic-auth-username <username> | Username for basic auth authentication. Required: With basic auth type. |
--webhook-basic-auth-password <password> | Password for basic auth authentication type. Required: With basic auth type. |
--webhook-bearer-token <token> | Bearer token for authorization. Required: With bearer auth type |