INFO-短信告警示例

适用模块
报警组件 easyalert
具体说明
短信告警接入平台,需用户提供短信接收端口以及curl成功示例
使用示例
1、easyops找到easy_alert组件,在advanced配置组分别添加参数template.channel.conf类型string,template.plugin_ali_sms.conf类型string
template.channel.conf配置如下
1 = {
  id = 2
  name = sms
  clz = "ali-sms"
  text = "短信"
  enable = true
}

template.plugin_ali_sms.conf 配置如下

name = "ali-sms"
post = true
url = "http://ip:port/xxxx"
//
setting = {
  wrap = "\n"
}
//
command = """
  function replace(String a){
    if(a == null){
      return a;
    } else {
      return org.apache.commons.lang3.StringUtils.replace(a, wrap, "");
    }
  }
  content = replace(content);
"""
header = {
}

param = {
}

body = {
  "telNumbers": "#{receiver}",  
  "taskName": "数据中台预警",
  "taskMsg": "#{content}"

}

2、easyops找到easy_alert组件,在advanced配置组分别添加参数
template.channel.conf类型string
template.plugin_ali_sms.conf类型string
补充参数信息后更新当前配置组-全部组件应用该版本,同步并重启 配置详情如下:

下图 INFO-短信告警示例 - 图1 INFO-短信告警示例 - 图2


作者:林帅