INFO-飞书webhook插件配置
    更新时间: 2025-10-29 11:23:50
    
    阅读 6580
    
INFO-飞书webhook插件配置
适用模块
报警组件 easyalert具体说明
配置飞书webhook告警-发至群组使用示例
1、添加机器人入群并复制地址
https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx
2、在插件配置(template.plugin=9.conf)中需要提供此变量,即url = 上述参数
####**1. 查询当前插件配置**
--查询SQL:
use easyalert;
select * from channel;
若当前存在8,9,10渠道需特别注意:
- 默认情况下8,9,10渠道分别为企业微信,钉钉,飞书的渠道配置,由于报警系统设计缺陷,只有10个渠道。
- 此文档,飞书webhook选择可渠道5,因为一般渠道10会被飞书插件(自建应用)占用2. EasyOps配置参数
#####**2.1 接口说明**
**Content-Type:**application/json
- 明确调用频次限制
- 明确消息长度限制
- 明确测试环境配置,生产环境参数配置
**请求样例**
curl -X POST -H "Content-Type: application/json" \
   -d '{"msg_type":"text","content":{"text":"request example"}}' \
  https://open.feishu.cn/open-apis/bot/v2/hook/xxxxxxxxxxxxxxxxx配置项组:advanced
增加 template.channel.conf 类型string
1 = {
  id = 5
  name = stone
  clz = "feishu-webhook"
  text = "飞书-webhook"
  enable = true
  channelIdentification = 'feishu-webhook'
  contentType = 'text'
}
增加 template.plugin_feishu_webhook.conf  类型string
name = "feishu-webhook"
post = true
url = "https://open.feishu.cn/open-apis/bot/v2/hook/xxxxx(替换)"
setting = {
}
command = """
  content = org.apache.commons.lang3.StringEscapeUtils.escapeJson(content);
"""
header = {
}
param = {
}
body = {
  "msg_type": "text",
  "content": {
    "text": "#{content}"
  }
}
EasyAlert同步配置重启,并重启3、若遇到以下报错(easyalert2.4.0.1以下版本)复制plugin_feishu_webhook.conf到plugins重启alert组件
easybdms@bigdata-demo9:/usr/easyops/easy_alert/default_easy_alert_server/current/conf$ pwd
/usr/easyops/easy_alert/default_easy_alert_server/current/conf
easybdms@bigdata-demo9:/usr/easyops/easy_alert/default_easy_alert_server/current/conf$ cp plugin_feishu_webhook.conf ../package/easy_alert-server-2.4.0/plugins/
作者:林帅
文档反馈
                    
                    
                    
                    
                
                    
以上内容对您是否有帮助?