ping

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package ping reports the status of a system responding to ICMP pings.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	// The statistic attribute is the statistic the compare, it can be packet_loss, avg_rtt, min_rtt, max_rtt or stddev_rtt
	Statistic string `hcl:"statistic"`
	// The severity attribute is the Severity that will be reported by the probe if the condition is met.
	Severity int `hcl:"severity"`
	// The threshold_gt_percentage is the threshold value for the packet_loss statistic.
	ThresholdGtPercentage float64 `hcl:"threshold_gt_percentage,optional"`
	// The threshold_gt_ms is the threshold value for the *_rtt statistics.
	ThresholdGtMs int `hcl:"threshold_gt_ms,optional"`
}

Condition ("condition" block) describes the ping statistics that will increase the severity of the probe's status.

type Config

type Config struct {
	// The address attribute sets the IP or hostname to send pings to.
	Address string `hcl:"address"`
	// The ping_interval attribute is the interval at which ping packets are sent.
	// This is not the same interval as the general interval attribute, which sets the interval at which the ping statistics will be evaluated to determine the probe's status.
	PingInterval string `hcl:"ping_interval,optional"`
	// The size_bytes attribute is the size of the ICMP packet to send, in bytes. It must be greater or equal to 24 (the default) and less than about 65500.
	Size int `hcl:"size_bytes,optional"`
	// The condition blocks describe which ping statistic results trigger which severity level for the probe.
	// By default, more than 3% of packet loss will be considered critical.
	CustomConditions []Condition `hcl:"condition,block"`
}

Config for the ping probe: it will send ICMP ping packets to the target and report conditions based on ping stastistics.

Jump to

Keyboard shortcuts

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