<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??一站式輕松地調用各大LLM模型接口,支持GPT4、智譜、豆包、星火、月之暗面及文生圖、文生視頻 廣告
                ## configuration 配置 --- [Alertmanager](https://github.com/prometheus/alertmanager)通過命令行和一個配置文件配置。命令行配置不可變的系統參數,而配置文件定義inhibiton規則,通知路由和通知接收者。 [可視化編輯器](https://prometheus.io/webtools/alerting/routing-tree-editor)可以幫助構建路由樹。 如果想要查看所有命令,請使用命令`alertmanager -h`。 `Alertmanager`能夠在運行時動態加載配置文件。如果新的配置有錯誤,則配置中的變化不會生效,同時錯誤日志被輸出到終端。通過發送`SIGHUP`信號量給這個進程,或者通過HTTP POST請求`/-/reload`,Alertmanager配置動態加載到內存。 ### 配置文件 使用`-config.file`指定要加載的配置文件 > ./alertmanager -config.file=simple.yml 這個配置文件使用`yaml`格式編寫的,括號表示參數是可選的,對于非列表參數,該值將設置為指定的默認值。 - `<duration>`: 與正則表達式匹配的持續時間`[0-9]+(ms|[smhdwy])` - `<labeltime>`: 與正則表達式匹配的字符串`[a-zA-Z_][a-zA-Z0-9_]*` - `<filepath>`: 當前工作目錄下的有效路徑 - `<boolean>`: 布爾值: `false` 或者 `true`。 - `<string>`: 常規字符串 - `<tmpl_string>`: 一個在使用前被模板擴展的字符串 其他占位符被分開指定, 一個有效的示例,點擊[這里](https://github.com/prometheus/alertmanager/blob/master/doc/examples/simple.yml) 全局配置指定的參數在所有其他上下文配置中是有效的。它們也作為其他區域的默認值。 ``` global: # ResolveTimeout is the time after which an alert is declared resolved # if it has not been updated. [ resolve_timeout: <duration> | default = 5m ] # The default SMTP From header field. [ smtp_from: <tmpl_string> ] # The default SMTP smarthost used for sending emails. [ smtp_smarthost: <string> ] # SMTP authentication information. [ smtp_auth_username: <string> ] [ smtp_auth_password: <string> ] [ smtp_auth_secret: <string> ] # The default SMTP TLS requirement. [ smtp_require_tls: <bool> | default = true ] # The API URL to use for Slack notifications. [ slack_api_url: <string> ] [ pagerduty_url: <string> | default = "https://events.pagerduty.com/generic/2010-04-15/create_event.json" ] [ opsgenie_api_host: <string> | default = "https://api.opsgenie.com/" ] [ hipchat_url: <string> | default = "https://api.hipchat.com/" ] [ hipchat_auth_token: <string> ] # Files from which custom notification template definitions are read. # The last component may use a wildcard matcher, e.g. 'templates/*.tmpl'. templates: [ - <filepath> ... ] # The root node of the routing tree. route: <route> # A list of notification receivers. receivers: - <receiver> ... # A list of inhibition rules. inhibit_rules: [ - <inhibit_rule> ... ] ``` ### <route> 一個路由塊在路由樹和它的孩子中定義了一個節點。如果不設置,它的可選配置參數從父節點中繼承其值。 每個警報在已配置路由樹的頂部節點,這個節點必須匹配所有警報。然后遍歷所有的子節點。如果`continue`設置成`false`, 當匹配到第一個孩子時,它會停止下來;如果`continue`設置成`true`, 則警報將繼續匹配后續的兄弟姐妹節點。如果一個警報不匹配一個節點的任何孩子,這個警報將會基于當前節點的配置參數來處理警報。 ``` [ receiver: <string> ] [ group_by: '[' <labelname>, ... ']' ] # Whether an alert should continue matching subsequent sibling nodes. [ continue: <boolean> | default = false ] # A set of equality matchers an alert has to fulfill to match the node. match: [ <labelname>: <labelvalue>, ... ] # A set of regex-matchers an alert has to fulfill to match the node. match_re: [ <labelname>: <regex>, ... ] # How long to initially wait to send a notification for a group # of alerts. Allows to wait for an inhibiting alert to arrive or collect # more initial alerts for the same group. (Usually ~0s to few minutes.) [ group_wait: <duration> ] # How long to wait before sending notification about new alerts that are # in are added to a group of alerts for which an initial notification # has already been sent. (Usually ~5min or more.) [ group_interval: <duration> ] # How long to wait before sending a notification again if it has already # been sent successfully for an alert. (Usually ~3h or more). [ repeat_interval: <duration> ] # Zero or more child routes. routes: [ - <route> ... ] ``` #### 示例 ``` # The root route with all parameters, which are inherited by the child # routes if they are not overwritten. route: receiver: 'default-receiver' group_wait: 30s group_interval: 5m repeat_interval: 4h group_by: [cluster, alertname] # All alerts that do not match the following child routes # will remain at the root node and be dispatched to 'default-receiver'. routes: # All alerts with service=mysql or service=cassandra # are dispatched to the database pager. - receiver: 'database-pager' group_wait: 10s match_re: service: mysql|cassandra # All alerts with the team=frontend label match this sub-route. # They are grouped by product and environment rather than cluster # and alertname. - receiver: 'frontend-pager' group_by: [product, environment] match: team: frontend ``` ### <inhibit_rule> 一個inhibition規則是在與另一組匹配器匹配的警報存在的條件下,使匹配一組匹配器的警報失效的規則。兩個警報必須具有一組相同的標簽。 ``` # Matchers that have to be fulfilled in the alerts to be muted. target_match: [ <labelname>: <labelvalue>, ... ] target_match_re: [ <labelname>: <regex>, ... ] # Matchers for which one or more alerts have to exist for the # inhibition to take effect. source_match: [ <labelname>: <labelvalue>, ... ] source_match_re: [ <labelname>: <regex>, ... ] # Labels that must have an equal value in the source and target # alert for the inhibition to take effect. [ equal: '[' <labelname>, ... ']' ] ``` ### <receiver> 接收者是一個或者多個通知集成的命名配置 **Alertmanager在v0.0.4中可用的其他接收器尚未實現。我們樂意接受任何貢獻,并將其添加到新的實現中** ``` # The unique name of the receiver. name: <string> # Configurations for several notification integrations. email_configs: [ - <email_config>, ... ] hipchat_configs: [ - <hipchat_config>, ... ] pagerduty_configs: [ - <pagerduty_config>, ... ] pushover_configs: [ - <pushover_config>, ... ] slack_configs: [ - <slack_config>, ... ] opsgenie_configs: [ - <opsgenie_config>, ... ] webhook_configs: [ - <webhook_config>, ... ] ``` ### <email_config> ``` # Whether or not to notify about resolved alerts. [ send_resolved: <boolean> | default = false ] # The email address to send notifications to. to: <tmpl_string> # The sender address. [ from: <tmpl_string> | default = global.smtp_from ] # The SMTP host through which emails are sent. [ smarthost: <string> | default = global.smtp_smarthost ] # SMTP authentication information. [ auth_username: <string> ] [ auth_password: <string> ] [ auth_secret: <string> ] [ auth_identity: <string> ] [ require_tls: <bool> | default = global.smtp_require_tls ] # The HTML body of the email notification. [ html: <tmpl_string> | default = '{{ template "email.default.html" . }}' ] # Further headers email header key/value pairs. Overrides any headers # previously set by the notification implementation. [ headers: { <string>: <tmpl_string>, ... } ] ``` ### <hipchat_config> ``` # Whether or not to notify about resolved alerts. [ send_resolved: <boolean> | default = false ] # The HipChat Room ID. room_id: <tmpl_string> # The auth token. [ auth_token: <string> | default = global.hipchat_auth_token ] # The URL to send API requests to. [ url: <string> | default = global.hipchat_url ] # See https://www.hipchat.com/docs/apiv2/method/send_room_notification # A label to be shown in addition to the sender's name. [ from: <tmpl_string> | default = '{{ template "hipchat.default.from" . }}' ] # The message body. [ message: <tmpl_string> | default = '{{ template "hipchat.default.message" . }}' ] # Whether this message should trigger a user notification. [ notify: <boolean> | default = false ] # Determines how the message is treated by the alertmanager and rendered inside HipChat. Valid values are 'text' and 'html'. [ message_format: <string> | default = 'text' ] # Background color for message. [ color: <tmpl_string> | default = '{{ if eq .Status "firing" }}red{{ else }}green{{ end }}' ] ``` ### <pagerduty_config> 通過PagerDuty ApI發送通知: ``` # Whether or not to notify about resolved alerts. [ send_resolved: <boolean> | default = true ] # The PagerDuty service key. service_key: <tmpl_string> # The URL to send API requests to [ url: <string> | default = global.pagerduty_url ] # The client identification of the Alertmanager. [ client: <tmpl_string> | default = '{{ template "pagerduty.default.client" . }}' ] # A backlink to the sender of the notification. [ client_url: <tmpl_string> | default = '{{ template "pagerduty.default.clientURL" . }}' ] # A description of the incident. [ description: <tmpl_string> | default = '{{ template "pagerduty.default.description" .}}' ] # A set of arbitrary key/value pairs that provide further detail # about the incident. [ details: { <string>: <tmpl_string>, ... } | default = { firing: '{{ template "pagerduty.default.instances" .Alerts.Firing }}' resolved: '{{ template "pagerduty.default.instances" .Alerts.Resolved }}' num_firing: '{{ .Alerts.Firing | len }}' num_resolved: '{{ .Alerts.Resolved | len }}' } ] ``` ### <pushover_config> 通過PUSHover API發送通知: ``` # The recipient user’s user key. user_key: <string> # Your registered application’s API token, see https://pushover.net/apps token: <string> # Notification title. [ title: <tmpl_string> | default = '{{ template "pushover.default.title" . }}' ] # Notification message. [ message: <tmpl_string> | default = '{{ template "pushover.default.message" . }}' ] # A supplementary URL shown alongside the message. [ url: <tmpl_string> | default = '{{ template "pushover.default.url" . }}' ] # Priority, see https://pushover.net/api#priority [ priority: <tmpl_string> | default = '{{ if eq .Status "firing" }}2{{ else }}0{{ end }}' ] # How often the Pushover servers will send the same notification to the user. # Must be at least 30 seconds. [ retry: <duration> | default = 1m ] # How long your notification will continue to be retried for, unless the user # acknowledges the notification. [ expire: <duration> | default = 1h ] ``` ### <slack_config> 通過Slack webhooks發送通知: ``` # Whether or not to notify about resolved alerts. [ send_resolved: <boolean> | default = false ] # The Slack webhook URL. [ api_url: <string> | default = global.slack_api_url ] # The channel or user to send notifications to. channel: <tmpl_string> # API request data as defined by the Slack webhook API. [ color: <tmpl_string> | default = '{{ if eq .Status "firing" }}danger{{ else }}good{{ end }}' ] [ username: <tmpl_string> | default = '{{ template "slack.default.username" . }}' [ title: <tmpl_string> | default = '{{ template "slack.default.title" . }}' ] [ title_link: <tmpl_string> | default = '{{ template "slack.default.titlelink" . }}' ] [ icon_emoji: <tmpl_string> ] [ icon_url: <tmpl_string> ] [ pretext: <tmpl_string> | default = '{{ template "slack.default.pretext" . }}' ] [ text: <tmpl_string> | default = '{{ template "slack.default.text" . }}' ] [ fallback: <tmpl_string> | default = '{{ template "slack.default.fallback" . }}' ] ``` ### <opsgenie_config> 通過OpsGenie API發送通知: ``` # Whether or not to notify about resolved alerts. [ send_resolved: <boolean> | default = true ] # The API key to use when talking to the OpsGenie API. api_key: <string> # The host to send OpsGenie API requests to. [ api_host: <string> | default = global.opsgenie_api_host ] # A description of the incident. [ description: <tmpl_string> | default = '{{ template "opsgenie.default.description" . }}' ] # A backlink to the sender of the notification. [ source: <tmpl_string> | default = '{{ template "opsgenie.default.source" . }}' ] # A set of arbitrary key/value pairs that provide further detail # about the incident. [ details: { <string>: <tmpl_string>, ... } ] # Comma separated list of team responsible for notifications. [ teams: <tmpl_string> ] # Comma separated list of tags attached to the notifications. [ tags: <tmpl_string> ] ``` ### <webhook_config> webhook接收者允許配置一個通用的接收者 ``` # Whether or not to notify about resolved alerts. [ send_resolved: <boolean> | default = true ] # The endpoint to send HTTP POST requests to. url: <string> ``` Alertmanager通過HTTP POST請求發送json格式的數據到配置端點: ``` { "version": "3", "groupKey": <number> // key identifying the group of alerts (e.g. to deduplicate) "status": "<resolved|firing>", "receiver": <string>, "groupLabels": <object>, "commonLabels": <object>, "commonAnnotations": <object>, "externalURL": <string>, // backling to the Alertmanager. "alerts": [ { "labels": <object>, "annotations": <object>, "startsAt": "<rfc3339>", "endsAt": "<rfc3339>" }, ... ] } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看