[root@prometheus ~]# vim /usr/local/Prometheus_grafana/conf/defaults.ini
# domain参数改为Grafana主机IP
domain = 192.168.137.130
# 找到并修改以下配置
[smtp]
enabled = true
host = smtp.126.com:25
user = "XXXXXXXXXX@126.com"
# If the password contains # or ; you have to wrap it with triple quotes. Ex """#password;"""
password = "XXXXXXXXXXXXXXXX"
cert_file =
key_file =
skip_verify = true
from_address = XXXXXXXXXXX@126.com
from_name = Grafana
ehlo_identity =
startTLS_policy =
在Dashboard中配置Alert
# 参数详解
Rule
Name "CPU usage alert" Evaluate every "30s" For "1m"
- Name # 规则名
- Evaluate every # 每次刮擦间隔
- For # 设置持续超出设定值的时间,触发告警
Conditions
WHEN "avg()" OF "