open-falcon configure e-mail alerts

1, download the binary installation package

cd /home/work/go/src/github.com/open-falcon
mkdir -p falcon-mail-provider
tar zxvf falcon-mail-provider.tar.gz -C falcon-mail-provider
cd falcon-mail-provider

2, modify the configuration file

{
    "debug": true,
    "http": {
        "listen": "0.0.0.0:4000",
        "token": ""
    },
    "smtp": {
        "addr": "smtp.qiye.163.com:25",
        "username": "[email protected]",
        "password": "youpassword",
        "from": "[email protected]",
        "tls":false,
        "anonymous":false,
        "skipVerify":true
    }
}

3, test configuration

./control start
[root@mgr falcon-mail-provider]# ./control tail
2019/09/18 11:46:00 config.go:71: load configuration file cfg.json successfully
2019/09/18 11:46:00 http.go:25: http listening 0.0.0.0:4000
[root@mgr falcon-mail-provider]# curl http://127.0.0.1:4000/sender/mail -d "[email protected],[email protected]&subject=xx&content=yy"
success
[root@mgr falcon-mail-provider]#

4, configure the alarm module configuration file cfg.json, modify the "mail": url "http://127.0.0.1:4000/sender/mail" option and restart

[root@mgr open-falcon]# cat alarm/config/cfg.json    
{
    "log_level": "debug",
    "http": {
        "enabled": true,
        "listen": "0.0.0.0:9912"
    },
    "redis": {
        "addr": "127.0.0.1:6379",
        "maxIdle": 5,
        "highQueues": [
            "event:p0",
            "event:p1",
            "event:p2"
        ],
        "lowQueues": [
            "event:p3",
            "event:p4",
            "event:p5",
            "event:p6"
        ],
        "userIMQueue": "/queue/user/im",
        "userSmsQueue": "/queue/user/sms",
        "userMailQueue": "/queue/user/mail"
    },
    "api": {
        "im": "http://127.0.0.1:10086/wechat",
        "sms": "http://127.0.0.1:10086/sms",
        "mail": "http://127.0.0.1:4000/sender/mail",
        "dashboard": "http://127.0.0.1:8081",
        "plus_api":"http://127.0.0.1:8080",
        "plus_api_token": "default-token-used-in-server-side"
    },
    "falcon_portal": {
        "addr": "root:@tcp(127.0.0.1:3306)/alarms?charset=utf8&loc=Local",
        "idle": 10,
        "max": 100
    },
    "worker": {
        "im": 10,
        "sms": 10,
        "mail": 50
    },
    "housekeeper": {
        "event_retention_days": 7,
        "event_delete_batch": 100
    }
}
[root@mgr open-falcon]# ./open-falcon restart alarm

5, configure the alarm template

5.1 Input template name inside the red box, and click the +

image.png

5.2 fill with content

spacer.gifimage.png

Guess you like

Origin blog.51cto.com/860143/2438867