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
Click to show internal directories.
Click to hide internal directories.