3

I am creating an application where I need to trigger a mail on particular event.

When I run following command,

python -m elastalert.elastalert --verbose --rule myrules\myrule.yml

I get the error as

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

Here is content of my rule file:

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"

Here is content of config.yaml file

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

Here is my smpt_auth file

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"

Here is content of smtp_auth_user file:

user: "<myMailId>@gmail.com"
password: "<password>"

What change I need to make to resolve the issue?

Has QUIT--Anony-Mousse
  • 76,138
  • 12
  • 138
  • 194
Deva
  • 1,039
  • 1
  • 14
  • 40

0 Answers0