Documentation ¶
Index ¶
- Variables
- func CallOthers(Num int, logsign string)
- func GetUserPhone(neednum int) string
- func LogsSign() string
- func PhoneCallPost(url string, u TXphonecall, logsign string) string
- func PostALYmessage(Messages, PhoneNumbers, logsign string) string
- func PostALYphonecall(Messages string, PhoneNumbers, logsign string) string
- func PostHWmessage(Messages string, PhoneNumbers, logsign string) string
- func PostTXmessage(Messages string, PhoneNumbers, logsign string) string
- func PostTXphonecall(Messages string, PhoneNumbers, logsign string) string
- func PostToDingDing(title, text, Ddurl, logsign string) string
- func PostToWeiXin(text, WXurl, logsign string) string
- func SendMessageG(message Graylog2, typeid int, logsign string) string
- func SendMessageG3(message Graylog3, typeid int, logsign string) string
- func SendMessageGrafana(message Grafana, typeid int, logsign string) string
- func SendMessageP(message Prometheus, logsign string) string
- func SendMessageR(message Prometheus, rwxurl, rddurl, rphone, logsign string) string
- type AlerMessages
- type AlertEvent
- type Alerts
- type Annotations
- type Backlog
- type CallBack
- type Check_result
- type DDMessage
- type G2Field
- type G3Field
- type Grafana
- type GrafanaController
- func (c *GrafanaController) GrafanaALYdh()
- func (c *GrafanaController) GrafanaALYdx()
- func (c *GrafanaController) GrafanaDingding()
- func (c *GrafanaController) GrafanaHwdx()
- func (c *GrafanaController) GrafanaTxdh()
- func (c *GrafanaController) GrafanaTxdx()
- func (c *GrafanaController) GrafanaWeixin()
- type Graylog2
- type Graylog2Controller
- func (c *Graylog2Controller) GraylogALYdh()
- func (c *Graylog2Controller) GraylogALYdx()
- func (c *Graylog2Controller) GraylogDingding()
- func (c *Graylog2Controller) GraylogHwdx()
- func (c *Graylog2Controller) GraylogTxdh()
- func (c *Graylog2Controller) GraylogTxdx()
- func (c *Graylog2Controller) GraylogWeixin()
- type Graylog3
- type Graylog3Controller
- func (c *Graylog3Controller) GraylogALYdh()
- func (c *Graylog3Controller) GraylogALYdx()
- func (c *Graylog3Controller) GraylogDingding()
- func (c *Graylog3Controller) GraylogHwdx()
- func (c *Graylog3Controller) GraylogTxdh()
- func (c *Graylog3Controller) GraylogTxdx()
- func (c *Graylog3Controller) GraylogWeixin()
- type Labels
- type MainController
- type Mark
- type MatchingMessage
- type Mobiles
- type Prometheus
- type PrometheusController
- type Re
- type TXmessage
- type TXphonecall
- type TengXunStatusController
- type Vcallback
- type WXMessage
Constants ¶
This section is empty.
Variables ¶
View Source
var PhoneCallMessage = ""
Functions ¶
func CallOthers ¶
func PhoneCallPost ¶
func PhoneCallPost(url string, u TXphonecall, logsign string) string
func PostALYmessage ¶
func PostALYphonecall ¶
func PostHWmessage ¶
华为云短信子程序
func PostTXmessage ¶
腾讯短信子程序
func PostTXphonecall ¶
腾讯语音子程序
func PostToDingDing ¶
func PostToWeiXin ¶
func SendMessageGrafana ¶
typeid 为0,触发电话告警和钉钉告警, typeid 为1 仅触发dingding告警
func SendMessageP ¶
func SendMessageP(message Prometheus, logsign string) string
func GetCSTtime(date string)(string) { T1:=date[0:10] T2:=date[11:19] T3:=T1+" "+T2 tm2, _ := time.Parse("2006-01-02 15:04:05", T3) h, _ := time.ParseDuration("-1h") tm3:=tm2.Add(-8*h) tm:=tm3.Format("2006-01-02 15:04:05") return tm }
func SendMessageR ¶
func SendMessageR(message Prometheus, rwxurl, rddurl, rphone, logsign string) string
Types ¶
type AlerMessages ¶
type AlerMessages []Alerts
按照 Alert.Level 从大到小排序
func (AlerMessages) Len ¶
func (a AlerMessages) Len() int
func (AlerMessages) Less ¶
func (a AlerMessages) Less(i, j int) bool
func (AlerMessages) Swap ¶
func (a AlerMessages) Swap(i, j int)
type AlertEvent ¶
type AlertEvent struct {
Source string `json:"source`
}
type Annotations ¶
type Annotations struct { Description string `json:"description"` Summary string `json:"summary"` //Level string `json:"level"` //2019年11月20日 16:04:04 删除Annotations level,改用label中的level Mobile string `json:"mobile"` //2019年2月25日 19:09:23 增加手机号支持 Ddurl string `json:"ddurl"` //2019年3月12日 20:33:38 增加多个钉钉告警支持 Wxurl string `json:"wxurl"` //2019年3月12日 20:33:38 增加多个钉钉告警支持 }
type CallBack ¶
type CallBack struct {
Voiceprompt_callback Vcallback `json:"voiceprompt_callback"`
}
type Check_result ¶
type Check_result struct { MatchingMessages []MatchingMessage `json:"matching_messages"` Result_description string `json:"result_description"` }
type GrafanaController ¶
type GrafanaController struct {
beego.Controller
}
func (*GrafanaController) GrafanaALYdh ¶
func (c *GrafanaController) GrafanaALYdh()
func (*GrafanaController) GrafanaALYdx ¶
func (c *GrafanaController) GrafanaALYdx()
func (*GrafanaController) GrafanaDingding ¶
func (c *GrafanaController) GrafanaDingding()
func (*GrafanaController) GrafanaHwdx ¶
func (c *GrafanaController) GrafanaHwdx()
func (*GrafanaController) GrafanaTxdh ¶
func (c *GrafanaController) GrafanaTxdh()
func (*GrafanaController) GrafanaTxdx ¶
func (c *GrafanaController) GrafanaTxdx()
func (*GrafanaController) GrafanaWeixin ¶
func (c *GrafanaController) GrafanaWeixin()
type Graylog2 ¶
type Graylog2 struct {
Check_result Check_result `json:"check_result"`
}
graylog2告警部分
type Graylog2Controller ¶
type Graylog2Controller struct {
beego.Controller
}
func (*Graylog2Controller) GraylogALYdh ¶
func (c *Graylog2Controller) GraylogALYdh()
func (*Graylog2Controller) GraylogALYdx ¶
func (c *Graylog2Controller) GraylogALYdx()
func (*Graylog2Controller) GraylogDingding ¶
func (c *Graylog2Controller) GraylogDingding()
for graylog alert
func (*Graylog2Controller) GraylogHwdx ¶
func (c *Graylog2Controller) GraylogHwdx()
func (*Graylog2Controller) GraylogTxdh ¶
func (c *Graylog2Controller) GraylogTxdh()
func (*Graylog2Controller) GraylogTxdx ¶
func (c *Graylog2Controller) GraylogTxdx()
func (*Graylog2Controller) GraylogWeixin ¶
func (c *Graylog2Controller) GraylogWeixin()
type Graylog3 ¶
type Graylog3 struct { Description string `json:"event_definition_description"` Event AlertEvent `json:"event"` Backlogs []Backlog `json:"backlog"` }
graylog3告警部分
type Graylog3Controller ¶
type Graylog3Controller struct {
beego.Controller
}
func (*Graylog3Controller) GraylogALYdh ¶
func (c *Graylog3Controller) GraylogALYdh()
func (*Graylog3Controller) GraylogALYdx ¶
func (c *Graylog3Controller) GraylogALYdx()
func (*Graylog3Controller) GraylogDingding ¶
func (c *Graylog3Controller) GraylogDingding()
for graylog3 alert
func (*Graylog3Controller) GraylogHwdx ¶
func (c *Graylog3Controller) GraylogHwdx()
func (*Graylog3Controller) GraylogTxdh ¶
func (c *Graylog3Controller) GraylogTxdh()
func (*Graylog3Controller) GraylogTxdx ¶
func (c *Graylog3Controller) GraylogTxdx()
func (*Graylog3Controller) GraylogWeixin ¶
func (c *Graylog3Controller) GraylogWeixin()
type MainController ¶
type MainController struct {
beego.Controller
}
func (*MainController) AlertTest ¶
func (c *MainController) AlertTest()
type MatchingMessage ¶
type Prometheus ¶
type PrometheusController ¶
type PrometheusController struct {
beego.Controller
}
func (*PrometheusController) PrometheusAlert ¶
func (c *PrometheusController) PrometheusAlert()
for prometheus alert 关于告警级别level共有5个级别,0-4,0 信息,1 警告,2 一般严重,3 严重,4 灾难
func (*PrometheusController) PrometheusRouter ¶
func (c *PrometheusController) PrometheusRouter()
type TXphonecall ¶
type TXphonecall struct { Ext string `json:"ext"` Tpl_id int `json:"tpl_id"` Params []string `json:"params"` Playtimes int `json:"playtimes"` Sig string `json:"sig"` Tel Mobiles `json:"tel"` Time int `json:"time"` }
腾讯语音提醒接口
type TengXunStatusController ¶
type TengXunStatusController struct {
beego.Controller
}
func (*TengXunStatusController) TengXunStatus ¶
func (c *TengXunStatusController) TengXunStatus()
type Vcallback ¶
type Vcallback struct { Result string `json:"result"` Accept_time string `json:"accept_time"` Call_from string `json:"call_from"` Callid string `json:"callid"` End_calltime string `json:"end_calltime"` Fee string `json:"fee"` Mobile string `json:"mobile"` Nationcode string `json:"nationcode"` Start_calltime string `json:"start_calltime"` }
Click to show internal directories.
Click to hide internal directories.