v1

package
v0.0.0-...-a0c03a0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2021 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler struct {
	Config *of.ACIConfig

	Aci *acigo.ACIClient
	Ams *alertmanager.AlertService

	Log *logger.Logger
	// contains filtered or unexported fields
}

func (*Handler) EnrichTopology

func (h *Handler) EnrichTopology(alert *alertmanager.Alert, nodes map[string]map[string]interface{})

Wrapper to update Labels with node and subsystem.

func (*Handler) FaultsToAlerts

func (h *Handler) FaultsToAlerts(faults []of.Map, nodes map[string]map[string]interface{}) ([]*alertmanager.Alert, error)

Convert acigo faults to Alertmanager alerts.

func (*Handler) GetAlertConfig

func (h *Handler) GetAlertConfig(fault of.ACIFaultRaw) (string, *aci_config.AlertConfig, error)

func (*Handler) GetConsulNodes

func (h *Handler) GetConsulNodes() []string

GetConsulNodes Lists the nodes from consul, matching given service and node metadata

func (*Handler) InitHandler

func (h *Handler) InitHandler()

func (*Handler) LoadConfig

func (h *Handler) LoadConfig(cfg of.Decoder, fileName string)

Wrapper to read a file into an implementation of of.Decoder.

func (*Handler) PushAlerts

func (h *Handler) PushAlerts()

Pull ACI faults and forward to Alertmanager.

func (*Handler) Run

func (h *Handler) Run()

func (*Handler) Shutdown

func (h *Handler) Shutdown() error

func (*Handler) Throttle

func (h *Handler) Throttle(totalCount int, f func(int, int))

Divide alerts into smaller chunks and spread posting to Alertmanager over h.Config.SendTime milliseconds.

func (*Handler) VerifiedHost

func (h *Handler) VerifiedHost(aciHost string) (string, string)

Do a forward and reverse lookup to verify the ACI Host. If DNS entry is found, Hostname and IP from DNS Query is returned else aciHost is returned

Jump to

Keyboard shortcuts

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