alarm

package
v0.0.0-...-31a2080 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 8, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckAlarmCount

func CheckAlarmCount(configPath string) func(*testing.T)

func CheckGetAlarmConfig

func CheckGetAlarmConfig(configPath string) func(*testing.T)

func CheckGetMonitoringCommandList

func CheckGetMonitoringCommandList(configPath string) func(*testing.T)

func CheckGetMonitoringPeriod

func CheckGetMonitoringPeriod(configPath string) func(*testing.T)

Types

type Alarmer

type Alarmer interface {
	GetMonitoringCommandList() []string
	GetMonitoringPeriod() time.Duration
	GetAlarmConfig() map[string]string
	GetAlarmCountMap() map[string]int
	GetTotalAlarmCountOfMonitoringCommand(monitoringCommand string) int

	Init(configMonitor *alarm.ConfigMonitor)

	Start()
	IsStarted() bool

	Stop()
}

func NewAlarmer

func NewAlarmer(configPath string) Alarmer

type SlackWebHookAlarmer

type SlackWebHookAlarmer struct {
	// contains filtered or unexported fields
}

func (*SlackWebHookAlarmer) GetAlarmConfig

func (a *SlackWebHookAlarmer) GetAlarmConfig() map[string]string

func (*SlackWebHookAlarmer) GetAlarmCountMap

func (a *SlackWebHookAlarmer) GetAlarmCountMap() map[string]int

func (*SlackWebHookAlarmer) GetMonitoringCommandList

func (a *SlackWebHookAlarmer) GetMonitoringCommandList() []string

func (*SlackWebHookAlarmer) GetMonitoringPeriod

func (a *SlackWebHookAlarmer) GetMonitoringPeriod() time.Duration

func (*SlackWebHookAlarmer) GetTotalAlarmCountOfMonitoringCommand

func (a *SlackWebHookAlarmer) GetTotalAlarmCountOfMonitoringCommand(namePattern string) int

func (*SlackWebHookAlarmer) Init

func (a *SlackWebHookAlarmer) Init(configMonitor *alarm.ConfigMonitor)

func (*SlackWebHookAlarmer) IsStarted

func (a *SlackWebHookAlarmer) IsStarted() bool

func (*SlackWebHookAlarmer) Start

func (a *SlackWebHookAlarmer) Start()

there will be only one go routine for monitoring ProcessInfo mutex is used to achieve it

func (*SlackWebHookAlarmer) Stop

func (a *SlackWebHookAlarmer) Stop()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL