Brian,
Please help with this.
Following your suggestion, I have my rule file defined:
groups:
- name: host-down
rules:
# Alert for any instance that is unreachable for >5 minutes.
- alert: InstanceDown
expr: probe_success == 0
for: 3m
labels:
severity: page
annotations:
summary: "Instance {{ $labels.instance }} down"
description: "{{ $labels.instance }} of job {{ $labels.job }} has
been down for more than 5 minutes."
And I have the alertmanager.yml:
global:
smtp_smarthost: 'localhost:25'
smtp_from: '[email protected]'
route:
group_by: ['alertname']
group_wait: 10s
group_interval: 10s
repeat_interval: 1h
receiver: team-X-mails
receivers:
- name: 'team-X-mails'
email_configs:
- to: '[email protected]'
inhibit_rules:
- source_match:
severity: 'critical'
target_match:
severity: 'warning'
equal: ['alertname']
SMTP smarthost is working fine, I have tested it by hand (I know well on
smtp server).
But, I never got an email... there is nothing info in local postfix 's log.
Can you help digging into this?
Thanks in advance.
On Sun, Sep 6, 2020 at 3:28 PM Brian Candler <[email protected]> wrote:
> On Sunday, 6 September 2020 06:16:43 UTC+1, Tom Black wrote:
>>
>> I have used blackbox exporter:
>> https://github.com/prometheus/blackbox_exporter
>>
>> but I just didn't know where to setup alert email when there was server
>> down.
>>
>>
> Blackbox_exporter will give you a metric "probe_success" which returns 0
> or 1. In prometheus you create an alerting rule on probe_success == 0, and
> you configure alertmanager with the E-mail destination.
> https://prometheus.io/docs/alerting/latest/overview/
>
>
> --
> 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/83b516b1-8bfa-49ad-96aa-51814efaca0bo%40googlegroups.com
> <https://groups.google.com/d/msgid/prometheus-users/83b516b1-8bfa-49ad-96aa-51814efaca0bo%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
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/CAMn7GYmtiF0vxM%3Dm%2BgtMf9x1JU_YkcJw-_fwefsAVozC24v43w%40mail.gmail.com.