1. 郵箱配置
/opt/n9e/server/etc/script
[root@n9e-v5 script]# ll
總用量 12
-rwxr-xr-x 1 501 games 10641 12月 13 14:07 notify.py
drwxr-xr-x 2 501 games 37 12月 13 14:00 tpl
notify.py 是郵箱的配置,一個Python腳本即時可以生效。
修改如下:
################################
## 郵件告警,修改下面的配置 ##
################################
mail_host = "mail.xxx.com.cn"
mail_port = 465
mail_user = "devops"
mail_pass = "Bxxdevops,."
mail_from = "devops@xxx.com.cn"
2. 資源管理 中配置
1.1 服務(wù)器打標(biāo)簽(非必要)
在資源管理中給每臺服務(wù)器打一個標(biāo)簽,便于報(bào)警策略配置中使用:

image.png
1.2 創(chuàng)建端口采集(必要)
給資源組添加端口采集,添加之后并不意味著會報(bào)警,只有報(bào)警策略中添加了指定服務(wù)器使用這個端口采集才會報(bào)警。

image.png
3. 配置告警策略

image.png