keepalived

package
v0.15.1 Latest Latest
Warning

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

Go to latest
Published: Jun 13, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadStatsFromDisk

func ReadStatsFromDisk(keepalivedStatsFile string) (string, time.Time, error)

ReadStatsFromDisk returns stats file as String and last modified time

Types

type Stats

type Stats map[string]VRRPInstance

func ParseStats

func ParseStats(statsContent string) (Stats, error)

type StatsEntry

type StatsEntry struct {
	VRRPInstance `yaml:"VRRP Instance"`
}

type VRRPInstance

type VRRPInstance struct {
	Advertisements struct {
		Received int `yaml:"Received"`
		Sent     int `yaml:"Sent"`
	} `yaml:"Advertisements"`
	BecameMaster   int `yaml:"Became master"`
	ReleasedMaster int `yaml:"Released master"`
	PacketErrors   struct {
		Length                int `yaml:"Length"`
		TTL                   int `yaml:"TTL"`
		InvalidType           int `yaml:"Invalid Type"`
		AdvertisementInterval int `yaml:"Advertisement Interval"`
		AddressList           int `yaml:"Address List"`
	} `yaml:"Packet Errors"`
	AuthenticationErrors struct {
		InvalidType  int `yaml:"Invalid Type"`
		TypeMismatch int `yaml:"Type Mismatch"`
		Failure      int `yaml:"Failure"`
	} `yaml:"Authentication Errors"`
	PriorityZero struct {
		Received int `yaml:"Received"`
		Sent     int `yaml:"Sent"`
	} `yaml:"Priority Zero"`
}

VRRPInstance represents the content of the /tmp/keepalived.stats file The content of the file is given by keepalived, that is the reason for spaces in yaml

func ReadStatsForInstanceName

func ReadStatsForInstanceName(instanceName, filename string) (VRRPInstance, time.Time, error)

ReadStatsForInstanceName returns VRRP Stats for an Instance and last modified time from the stats file

func (VRRPInstance) IsMaster

func (v VRRPInstance) IsMaster() bool

Jump to

Keyboard shortcuts

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