Alerting
groups:
- name: example
rules:
- alert: InstanceDown
expr: up == 0
for: 1mrule_files:
- rules.yml
alerting:
alertmanagers:
- static_configs:
- targets: ['localhost:9093']



Last updated
groups:
- name: example
rules:
- alert: InstanceDown
expr: up == 0
for: 1mrule_files:
- rules.yml
alerting:
alertmanagers:
- static_configs:
- targets: ['localhost:9093']



Last updated
$ wget https://github.com/prometheus/alertmanager/releases/download/v0.16.0/alertmanager-0.16.0.linux-amd64.tar.gz
$ tar -xzf alertmanager-*.linux-amd64.tar.gz
$ cd alertmanager-*.linux-amd64/global:
resolve_timeout: 5m #处理超时时间,默认为5min
smtp_smarthost: 'smtp.163.com:25' # 邮箱smtp服务器代理
smtp_from: '177xxxx7xx6@163.com' # 发送邮箱名称
smtp_auth_username: '177xxxx7xx6@163.com' # 邮箱账号
smtp_auth_password: 'xxxxxxxxx' # 邮箱密码或授权码
route:
receiver: example-email
receivers:
- name: example-email # 路由中对应的receiver名称
email_configs: # 邮箱配置
- send_resolved: true #故障恢复的时候时候发邮件
to: 'youraddress@xxx.com'$ ./alertmanager
level=info ts=2019-01-18T03:23:25.618242308Z caller=main.go:174 msg="Starting Alertmanager" version="(version=0.15.3, branch=HEAD, revision=d4a7697cc90f8bce62efe7c44b63b542578ec0a1)"
level=info ts=2019-01-18T03:23:25.618299711Z caller=main.go:175 build_context="(go=go1.11.2, user=root@4ecc17c53d26, date=20181109-15:40:48)"
level=info ts=2019-01-18T03:23:25.620962633Z caller=cluster.go:155 component=cluster msg="setting advertise address explicitly" addr=172.25.0.4 port=9094
level=info ts=2019-01-18T03:23:25.622780056Z caller=main.go:322 msg="Loading configuration file" file=/etc/alertmanager/config.yml
level=info ts=2019-01-18T03:23:25.62283361Z caller=cluster.go:570 component=cluster msg="Waiting for gossip to settle..." interval=2s
level=info ts=2019-01-18T03:23:25.625547849Z caller=main.go:398 msg=Listening address=:9093
level=info ts=2019-01-18T03:23:27.623182959Z caller=cluster.go:595 component=cluster msg="gossip not settled" polls=0 before=0 now=1 elapsed=2.000272s
level=info ts=2019-01-18T03:23:35.624264613Z caller=cluster.go:587 component=cluster msg="gossip settled; proceeding" elapsed=10.001369295s