Documentation ¶
Index ¶
- func AddTarget(target *targetConfig, privileged bool, ipv4 bool, ipv6 bool) pool.WorkFunc
- func New(b *beat.Beat, cfg *common.Config) (beat.Beater, error)
- func NewTargets(cfg []*common.Config, privileged bool, ipv4 bool, ipv6 bool) map[string]Target
- func RecvPings(myID int, bt *Pingbeat, state *PingState, conn *icmp.PacketConn)
- func SendPing(conn *icmp.PacketConn, timeout time.Duration, seq int, addr net.Addr) pool.WorkFunc
- type PingInfo
- type PingRecord
- type PingState
- type Pingbeat
- type Target
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddTarget ¶
AddTarget takes a target name and tag, fetches the IP addresses associated with it and adds them to the Pingbeat struct
func NewTargets ¶
Types ¶
type PingInfo ¶
type PingInfo struct { ID int Seq int Target string Sent time.Time Received time.Time RTT time.Duration Loss bool LossReason string }
PingInfo contains details about active ping requests/replies
type PingRecord ¶
PingRecord is used to hold when a EchoRequest was sent to a target
func NewPingRecord ¶
func NewPingRecord(target string) *PingRecord
NewPingRecord creates a new PingRecord for the given target
type PingState ¶
PingState is used to keep track of active EchoRequests
func (*PingState) CalcPingRTT ¶
CalcPingRTT calculates the time since a request was sent, e.g., the RTT
func (*PingState) CleanPings ¶
CleanPings reaps requests in PingState that have timed out (i.e., no response received before Pingbeat global timeout)
type Pingbeat ¶
type Pingbeat struct {
// contains filtered or unexported fields
}
Pingbeat contains configuration details
func (*Pingbeat) ProcessPing ¶
ProcessPing fetches the details of this ping from the current state and then creates an ping event to be published