Documentation ¶
Index ¶
- Variables
- func AddReporter(newReporter IReporter)
- func ClearReporter(newReporter IReporter)
- func Done()
- func GetAgainReportBaseInterval() time.Duration
- func GetAgainReportMaxInterval() time.Duration
- func GetDingtalTels() []string
- func GetDingtalkAtAll() bool
- func GetDingtalkUrl() string
- func GetKeepRunning() bool
- func GetMonitorName() string
- func GetReportType() string
- func GetScanInterval() time.Duration
- func GetScaningInterval() time.Duration
- func GetSmtpHost() string
- func GetSmtpPort() int
- func GetSmtpPwd() string
- func GetSmtpRecever() []string
- func GetSmtpSender() string
- func GetSmtpUserName() string
- func InitReports()
- func SetAgainReportBaseInterval(val time.Duration)
- func SetAgainReportBaseIntervalFromStr(val string) error
- func SetAgainReportMaxInterval(val time.Duration)
- func SetAgainReportMaxIntervalFromStr(val string) error
- func SetDingtalTels(val []string)
- func SetDingtalkAtAll(val bool)
- func SetDingtalkUrl(val string)
- func SetKeepRunning(val bool)
- func SetMonitorName(val string)
- func SetReportType(val string)
- func SetScanInterval(val time.Duration)
- func SetScanIntervalFromStr(val string) error
- func SetScaningInterval(val time.Duration)
- func SetScaningIntervalFromStr(val string) error
- func SetScanner(newScanner IScaner)
- func SetSmtpHost(val string)
- func SetSmtpPort(val int)
- func SetSmtpPwd(val string)
- func SetSmtpRecever(val []string)
- func SetSmtpSender(val string)
- func SetSmtpUserName(val string)
- func Start()
- func TrigReport(msg string)
- type DingtalkReporter
- type EmailReporter
- type IReporter
- type IScaner
- type ScanResult
Constants ¶
This section is empty.
Variables ¶
View Source
var AgainReportBaseInterval = time.Duration(60 * time.Second)
View Source
var AgainReportMaxInterval = time.Duration(60 * 60 * time.Second) //1hour
View Source
var DingtalTels []string
View Source
var DingtalkAtAll = false
View Source
var DingtalkUrl = "https://oapi.dingtalk.com/robot/send?access_token=32e0699c542e314680b05a9c947577395b86389bd4fe2853181b14b055c4a5ed"
View Source
var KeepRunning = true
View Source
var Lang_First_Report = "%s first Fail\nmsg:%s"
View Source
var Lang_ReportAgain = "%s scan count %d, duration time:%s\n msg:%s"
View Source
var Lang_ReportRecover = "%s is recover, duration time:%s"
View Source
var Logger midlog.Midlog = midlog.New("libMonitor")
View Source
var MonitorName = "My Monitor"
View Source
var ReportType = "email" //dingtalk or email
View Source
var ScanInterval = time.Duration(30 * time.Second)
View Source
var ScaningInterval = time.Duration(5 * time.Second)
View Source
var SmtpHost = ""
View Source
var SmtpPort = 25
View Source
var SmtpPwd = ""
View Source
var SmtpRecever []string //aa@gmail.com,bb@yahoo.com
View Source
var SmtpSender = ""
View Source
var SmtpUserName = ""
View Source
var StartFailedTime time.Time
Functions ¶
func AddReporter ¶
func AddReporter(newReporter IReporter)
func ClearReporter ¶
func ClearReporter(newReporter IReporter)
func GetDingtalTels ¶
func GetDingtalTels() []string
func GetDingtalkAtAll ¶
func GetDingtalkAtAll() bool
func GetDingtalkUrl ¶
func GetDingtalkUrl() string
func GetKeepRunning ¶
func GetKeepRunning() bool
func GetMonitorName ¶
func GetMonitorName() string
func GetReportType ¶
func GetReportType() string
func GetScanInterval ¶
func GetScaningInterval ¶
func GetSmtpHost ¶
func GetSmtpHost() string
func GetSmtpPort ¶
func GetSmtpPort() int
func GetSmtpPwd ¶
func GetSmtpPwd() string
func GetSmtpRecever ¶
func GetSmtpRecever() []string
func GetSmtpSender ¶
func GetSmtpSender() string
func GetSmtpUserName ¶
func GetSmtpUserName() string
func InitReports ¶
func InitReports()
func SetDingtalTels ¶
func SetDingtalTels(val []string)
func SetDingtalkAtAll ¶
func SetDingtalkAtAll(val bool)
func SetDingtalkUrl ¶
func SetDingtalkUrl(val string)
func SetKeepRunning ¶
func SetKeepRunning(val bool)
func SetMonitorName ¶
func SetMonitorName(val string)
func SetReportType ¶
func SetReportType(val string)
func SetScanInterval ¶
func SetScanIntervalFromStr ¶
func SetScaningInterval ¶
func SetScanner ¶
func SetScanner(newScanner IScaner)
func SetSmtpHost ¶
func SetSmtpHost(val string)
func SetSmtpPort ¶
func SetSmtpPort(val int)
func SetSmtpPwd ¶
func SetSmtpPwd(val string)
func SetSmtpRecever ¶
func SetSmtpRecever(val []string)
func SetSmtpSender ¶
func SetSmtpSender(val string)
func SetSmtpUserName ¶
func SetSmtpUserName(val string)
func TrigReport ¶
func TrigReport(msg string)
Types ¶
type DingtalkReporter ¶
type DingtalkReporter struct{}
func (DingtalkReporter) Report ¶
func (DingtalkReporter) Report(msg string)
type EmailReporter ¶
type EmailReporter struct{}
func (EmailReporter) Report ¶
func (EmailReporter) Report(msg string)
type ScanResult ¶
* Result of IScaner invoke
Click to show internal directories.
Click to hide internal directories.