12345678910111213141516171819202122232425 |
- package alarm_msg
- import (
- "encoding/json"
- "eta_gn/eta_bridge/global"
- "eta_gn/eta_bridge/utils"
- )
- var (
- AlarmMsgUrl = "http://127.0.0.1:8606/api/alarm/send"
- )
- func SendAlarmMsg(msgBody string, level int) {
- params := make(map[string]interface{})
- params["ProjectName"] = utils.APPNAME
- params["RunMode"] = global.CONFIG.Serve.RunMode
- params["MsgBody"] = msgBody
- params["Level"] = level
- param, err := json.Marshal(params)
- if err != nil {
- global.LOG.Critical("SendAlarmMsg json.Marshal Err:" + err.Error())
- return
- }
- global.FILE_LOG.Info(string(param))
- }
|