elasticsearch - 如何解决 elastalert 中的“连接到 SMTP 主机时出错”?
问题描述
我正在创建一个应用程序,我需要在其中触发特定事件的邮件。
当我运行以下命令时,
python -m elastalert.elastalert --verbose --rule myrules\myrule.yml
我得到错误
ERROR:root:Error while running alert email: Error connecting to SMTP host: [Error 10013] An attempt was made to access a socket in a way forbidden by its access permissions
这是我的规则文件的内容:
es_host: localhost
es_port: 9200
name: Log Level Test
type: frequency
index: testindexv4
num_events: 1
timeframe:
hours: 4
filter:
- term:
log_level.keyword: "ERROR"
- query:
query_string:
query: "log_level.keyword: ERROR"
alert:
- "email"
email:
- "<myMailId>@gmail.com"
这是 config.yaml 文件的内容
rules_folder: myrules
run_every:
seconds: 2
buffer_time:
seconds: 10
es_host: localhost
es_port: 9200
writeback_index: elastalert_status
alert_time_limit:
days: 2
这是我的 smpt_auth 文件
alert:
- email
email:
- "<myMailId>@gmail.com"
smtp_host: "smtp.gmail.com"
smtp_port: 465
smtp_ssl: true
from_addr: "<otherMailId>@gmail.com"
smtp_auth_file: "smtp_auth_user.yaml"
这是 smtp_auth_user 文件的内容:
user: "<myMailId>@gmail.com"
password: "<password>"
我需要做出什么改变来解决这个问题?
解决方案
推荐阅读
- c# - 在 Asp.net MVC 中连接两个或多个对象
- c# - 无法使用图形 sdk 在在线共享点中创建新列表
- sql - 如何优化具有多个 OR、AND、IN 语句的查询?
- react-native - 可点击的地图视图标记
- ios - 当我向 iOS 请求许可时,我可以更改措辞并重新定义按钮吗?
- database - 查找一个字段的值不为空且不存在于其他字段中的 MongoDB 文档
- c - 为 FFTW 函数添加自定义后缀
- python - 在opencv中使用MSER检测灰度图像上的白色斑点
- shopify - 是否可以向 Shopify 中的所有产品批量添加元字段?
- javascript - 来自服务器的 React-Native 动态数组