cat /etc/prometheus/prometheus.yml
global:
scrape_interval: 15s
rule_files:
- /etc/prometheus/alert.rules.yml
- /etc/prometheus/prometheus_rules.yaml
scrape_configs:
- job_name: 'prometheus'
scrape_interval: 15s
static_configs:
- targets: ['localhost:9090']
- job_name: 'node_exporter'
scrape_interval: 5s
static_configs:
- targets: ['localhost:9100']
alerting:
alertmanagers:
- static_configs:
- targets: ['localhost:9093']
cat /etc/alertmanager/alertmanager.yml
global:
smtp_smarthost: 'smtp.office365.com:587'
smtp_from: 'us...@domain.com'
smtp_auth_username: 'us...@domain.com'
smtp_auth_password: 'password1'
templates:
- '/etc/alertmanager/template/*.tmpl'
route:
repeat_interval: 3h
receiver: team-X-mails
receivers:
- name: 'team-X-mails'
email_configs:
- to: 'us...@domain.com'
cat /etc/prometheus/alert.rules.yml
groups:
- name: alert.rules
rules:
- alert: memory_high
expr: node_memory_MemFree_bytes > 100
for: 15s
annotations:
description: '{{ $labels.instance }} has lots of memory man (current value:
{{ $value }}s)'
summary: Prometheus using more memory than it should {{ $labels.instance }}
cat /etc/prometheus/prometheus_rules.yaml
groups:
- name: prometheus.rules
rules:
- record: node_memory_MemFree_bytes
expr: node_memory_MemFree_bytes
--
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 prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/b41ca2a6-0c87-4924-b74f-43c52292f197%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Also, I have checked the Office 365 Logs - the us...@domain.com does not even try to connect. Is it possible to trigger an alert manually and send it via email just to check it works?
An extra question: after editing an alert rule what I have to restart: prometheus or areltmanager or both of them? In a specific order?
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To post to this group, send email to promethe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/b41ca2a6-0c87-4924-b74f-43c52292f197%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/382396d3-eb47-4e1e-8aef-7d654a132a9a%40googlegroups.com.
Aug 20 12:13:58 prom2 alertmanager[368]: level=error ts=2018-08-20T10:13:58.30051394Z caller=dispatch.go:280 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="*notify.loginAuth failed: 535 5.7.3 Authentication unsuccessful [LO2P265CA0146.GBRP265.PROD.OUTLOOK.COM]"
global:
smtp_smarthost: 'smtp.gmail.com:587'
smtp_from: 'm...@gmail.com'
smtp_auth_username: 'm...@gmail.com'
smtp_auth_password: '------------------------'
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f4da7101-6f3c-4254-8437-a0376c90637b%40googlegroups.com.To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f4da7101-6f3c-4254-8437-a0376c90637b%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/f4da7101-6f3c-4254-8437-a0376c90637b%40googlegroups.com.
global:
smtp_smarthost: 'smtp.gmail.com:587'
smtp_from: 'm...@gmail.com'
smtp_auth_identity: 'm...@gmail.com'
smtp_auth_username: 'prometheus'
smtp_auth_password: 'alvy orzb lgsc bltl'
templates:
- '/etc/alertmanager/template/*.tmpl'
route:
repeat_interval: 1h
receiver: Test-Email
receivers:
- name: 'Test-Email'
email_configs:
- to: 'm...@domain.com'
Aug 21 15:06:16 prom2 alertmanager[1664]: level=error ts=2018-08-21T13:06:16.027803309Z caller=dispatch.go:280 component=dispatcher msg="Notify for alerts failed" num_alerts=1 err="*notify.loginAuth failed: 535 5.7.8 Username and Password not accepted. Learn more at\n5.7.8 https://support.google.com/mail/?p=BadCred
Make sure you are using App password instead of gmail password