0
を送信すると、GmailのSMTPサーバーを介して電子メールを送信しようとしているが、続けない取得エラーelastalert私はドッカー画像に弾性アラートを設定し、電子メール
マイconfig.yamlファイルは次のとおりです。
...
smtp_auth_file: /usr/local/bin/elastalert/rules/email_auth.yaml
smtp_host: smtp.gmail.com
from_addr: [email protected]
user: "username"
password: "password"
しかし、私は取得していますエラーは次のとおりです:
私の電子メールのautheticationファイルがある
util.EAException: Error loading file /usr/local/bin/elastalert/rules/email_auth.yaml: Invalid Rule: None
{'from_addr': '[email protected]', 'smtp_ssl': True, 'smtp_host': 'smtp.gmail.com', 'user': 'username', 'rule_file': '/usr/local/bin/elastalert/rules/email_auth.yaml', 'password': 'password'} is valid under each of {'properties': {'type': {'pattern': '[.]'}}, 'title': 'Custom Rule from Module'}, {'properties': {'type': {'enum': ['any']}}, 'title': 'Any'}
Failed validating 'oneOf' in schema:
{'$schema': 'http://json-schema.org/draft-04/schema#',
'definitions': {'arrayOfStrings': {'items': {'type': 'string'},
'type': ['string', 'array']},
'arrayOfStringsOrOtherArrays': {'items': {'type': ['string',
'array']},
'type': ['string',
'array']},
'filter': {},
'timeFrame': {'additionalProperties': False,
'properties': {'days': {'type': 'number'},
'hours': {'type': 'number'},
'milliseconds': {'type': 'number'},
'minutes': {'type': 'number'},
'schedule': {'type': 'string'},
'seconds': {'type': 'number'},
'weeks': {'type': 'number'}},
'type': 'object'}},
'oneOf': [{'properties': {'type': {'enum': ['any']}},
'title': 'Any'},
{'properties': {'blacklist': {'items': {'type': 'string'},
'type': 'array'},
'compare_key': {'type': 'string'},
'type': {'enum': ['blacklist']}},
'required': ['blacklist', 'compare_key'],
'title': 'Blacklist'},
{'properties': {'compare_key': {'type': 'string'},
'ignore_null': {'type': 'boolean'},
'type': {'enum': ['whitelist']},
'whitelist': {'items': {'type': 'string'},
'type': 'array'}},
'required': ['whitelist', 'compare_key', 'ignore_null'],
'title': 'Whitelist'},
{'properties': {'compare_key': {'type': 'string'},
'ignore_null': {'type': 'boolean'},
'timeframe': {'additionalProperties': False,
'properties': {'days': {'type': 'number'},
'hours': {'type': 'number'},
'milliseconds': {'type': 'number'},
'minutes': {'type': 'number'},
'schedule': {'type': 'string'},
'seconds': {'type': 'number'},
'weeks': {'type': 'number'}},
'type': 'object'},
'type': {'enum': ['change']}},
'required': ['query_key', 'compare_key', 'ignore_null'],
'title': 'Change'},
私はelastalert/config.pyとschma.yamlを調べて、smtp_auth_file、user、およびpasswordプロパティがschma.yamlにも定義されていないことを確認しました。 Valifationエラーの原因は何ですか?誰が私のセットアップが間違っていたのか知っていますか?ありがとう
あなたの 'email_auth.yaml'ファイルは' user'と 'password'設定のみを含んでいなければなりません。残りはすべて[documentation](http://elastalert.readthedocs.io)に書かれているように' config.yaml'に入ります。 /en/latest/ruletypes.html?highlight=smtp_auth_file#email) – Val
ありがとう、私はそれを試みたが、それは私に同じエラーを与えた。 –
ルールファイルの検証にエラーがあり、ユーザーとパスワードを見つけることができないと思われますが、設定が間違っている可能性があります。 –