By adding labels to some alerts (which you can do in your alerting rules), 
and by matching on those labels in the "routes 
<https://prometheus.io/docs/alerting/latest/configuration/#route>" section 
of your alertmanager config.

There are examples here 
<https://prometheus.io/docs/alerting/latest/configuration/#example> and in 
the archives of this group.  Also, you may find this interactive routing 
tree editor/tester helpful:
https://prometheus.io/webtools/alerting/routing-tree-editor/

On Friday, 20 November 2020 at 16:05:51 UTC [email protected] wrote:

> Hello people.
> this is my blackbox configuration it has two files (lists of sites). below 
> my configuration of alerts using slack.
>
>
> my question is, how can i use different receiver for each list in the 
> blackbox. ex: sites01.yml use slack
> sites02.yml use email.
>
>
> ####config blackbox  
> - job_name: 'blackbox'
>     scrape_interval: 30s
>     scrape_timeout: 20s
>     metrics_path: /probe
>     params:
>       module: [http_2xx]  # Look for a HTTP 200 response.
>     file_sd_configs:
>       - files:
>         - /etc/prometheus/sites01.yml
>         - /etc/prometheus/sites02.yml
>     relabel_configs:
>       - source_labels: [__address__]
>         target_label: __param_target
>       - source_labels: [__param_target]
>         target_label: instance
>       - target_label: __address__
>         replacement: "blackbox_exporter:9115"  # Blackbox exporter.
>
> ###config alertmanager
> receivers:
>   - name: 'slack'
>     slack_configs:
>     - api_url: 'https://hooks.slack.com/services/...'
>       send_resolved: true
>       username: 'jcm'
>       channel: '#alert'
>       title: '[{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ 
> .Alerts.Firing | len }}{{ end }}] Notificações de Status - {{if eq .Status 
> "firing"}}Site(s) OffLine!{{else}}Sites Sucessfull!{{end}} {{if eq .Status 
> "firing"}}:fire:{{else}}:raised_hands:{{end}}'
>       text: "{{ range .Alerts }}*Description:* 
> {{.Annotations.description}}\n{{end}}
>

-- 
You received this message because you are subscribed to the Google Groups 
"Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/prometheus-users/e4c91cbd-6df0-42d1-9920-c82d27d563fcn%40googlegroups.com.

Reply via email to