2016-10-19 9 views
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エラーの原因は何ですか?誰が私のセットアップが間違っていたのか知​​っていますか?ありがとう

+0

あなたの 'email_auth.yaml'ファイルは' user'と 'password'設定のみを含んでいなければなりません。残りはすべて[documentation](http://elastalert.readthedocs.io)に書かれているように' config.yaml'に入ります。 /en/latest/ruletypes.html?highlight=smtp_auth_file#email) – Val

+0

ありがとう、私はそれを試みたが、それは私に同じエラーを与えた。 –

+0

ルールファイルの検証にエラーがあり、ユーザーとパスワードを見つけることができないと思われますが、設定が間違っている可能性があります。 –

答えて

0

私は問題を発見しました。 email_authentication.yamlを私のrule_folderの同じフォルダに配置しました。私が一度それを動かすと、このエラーは解決されました。

関連する問題