checks

package
v0.0.0-...-943ae65 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2017 License: MIT Imports: 18 Imported by: 2

Documentation

Index

Constants

View Source
const (
	ADD    int = 1
	REMOVE int = 2
)

Variables

This section is empty.

Functions

func InitGM

func InitGM(ipAddresses []string, dryRun bool)

InitGM - initialize the Global Map struct

func InitPeersIPViews

func InitPeersIPViews()

InitPeersIPViews - initialize the state of Peers' IP views to be true

func NewChecks

func NewChecks(dnsConfig dns.Provider, threshold int, interval time.Duration, port int)

NewChecks initializes the *HealthTracker struct for health checks

func NotifyIPState

func NotifyIPState(ipAddress string, live bool, peerUpdate bool) error

NotifyIPState - notify peer agents of change in state of monitored IP

func StartPingMon

func StartPingMon(threshold int)

StartPingMon to initialize and start ping monitor

func StartTCPChecks

func StartTCPChecks(threshold int)

StartTCPChecks to run the registered tcp based health checks in separate goroutines

func UpdateGlobalState

func UpdateGlobalState(ipAddress string, live bool, peer string) (liveCheck int)

UpdateGlobalState - update ipstate in Peers' views based on http update

Types

type GlobalMap

type GlobalMap struct {
	IPLive map[string]bool // true if an IP is still alive and false otherwise

	MinAgreement int
	Mutex        *sync.RWMutex
	Peers        []string
	LocalAddr    string
	Clustered    bool
	Members      *quorums.MemList
	DryRun       bool
	CryptoKey    string
	Type         string
	Dmutex       *dmutex.Dmutex
	// contains filtered or unexported fields
}

GlobalMap struct for managing network of monitoring agents and monitored IPs

var Gm *GlobalMap

Gm var for the global map of monitored IPs

type HTTPUpdate

type HTTPUpdate struct {
	Peer      string
	IPAddress string
	Live      bool
}

HTTPUpdate to manage peer monitoring agent updates

type HealthTracker

type HealthTracker struct {
	Results          map[string]*response
	P                *fastping.Pinger
	TCPChecks        map[string]string
	AddressFails     map[string]int
	AddressSuccesses map[string]int
	DNS              dns.Provider
	Mutex            *sync.RWMutex
	Interval         time.Duration
}

HealthTracker struct to manage monitoring agent context

var Master *HealthTracker

Master pinger

Jump to

Keyboard shortcuts

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