Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type TCPMonitor ¶
type TCPMonitor struct { Name string `json:"name"` // 这个服务的名称 Hosts []string `json:"host"` // 主机地址:以逗号分隔,\;分隔 Port int `json:"port"` // 服务端口 Times int `json:"times"` // 成功或者失败检查次数:默认2次 Interval int `json:"interval"` // 间隔秒数:默认30秒 Timemout int `json:"timemout"` // 超时时间秒数:默认5秒 Emails []string `json:"emails"` // 邮件告警 Phones []string `json:"phones"` // 电话告警 Users []string `json:"users"` // 告警通知人员: 通过wechart、DingDing等发送告警消息 Status string `json:"status"` // 当前状态: Ready, Running, IsError, IsSuccess, Done Count int64 `json:"count"` // 总共执行次数 // contains filtered or unexported fields }
TCPMonitor Struct
func (*TCPMonitor) ExecuteMonitorLoop ¶
func (tcpMonitor *TCPMonitor) ExecuteMonitorLoop()
ExecuteMonitorLoop 执行tcp监控循环函数
func (*TCPMonitor) SendErrorMessage ¶
func (tcpMonitor *TCPMonitor) SendErrorMessage(message string) (success bool, err error)
SendErrorMessage 发送错误消息
func (*TCPMonitor) SendRecoverMessage ¶
func (tcpMonitor *TCPMonitor) SendRecoverMessage(message string) (success bool, err error)
SendRecoverMessage 发送恢复消息 开始出现了异常,后面恢复了,需发送恢复消息
Click to show internal directories.
Click to hide internal directories.