Documentation ¶
Overview ¶
Package probe stores basic probes that are used to check services health
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Target string Options map[string]interface{} Warning time.Duration Fatal time.Duration }
Config holds probe configuration, submitted through Init methods.
type DNS ¶
type DNS struct { Config // contains filtered or unexported fields }
DNS Probe, used to check whether a DNS server is answering. `domain` will be resolved through a lookup for an A record. `expected` should be the first returned IPv4 address or empty to accept any IP address.
type HTTP ¶
type HTTP struct { Config // contains filtered or unexported fields }
HTTP Probe, used to check HTTP(S) websites status.
type HTTPOptions ¶
HTTPOptions is a structure containing optional parameters. The `Regex` is used to check the content of the website, and can be empty. Set `VerifyCertificate` to `false` to skip the TLS certificate verification.
type Minecraft ¶
type Minecraft struct {
Config
}
Minecraft Probe, used to check minecraft servers status
func (*Minecraft) Probe ¶
Probe checks a minecraft server status. If the operation succeeds, the message will contain the number of connected and allowed players and the server version. If there is no slot available for a new player, a warning will be triggered. Otherwise, an error message is returned.
type Port ¶
type Port struct { Config // contains filtered or unexported fields }
Port Probe, used to check if a port is open or not.
type SMTP ¶
type SMTP struct {
Config
}
SMTP Probe, used to check smtp servers status BEWARE! Only full TLS servers are working with this probe.
type Status ¶
type Status string
Status represents the current status of a monitored service.
const ( StatusUnknown Status = "" StatusWarning Status = "WARNING" StatusError Status = "ERROR" StatusOK Status = "OK" )
These constants represent the different available statuses of a service.
func EvaluateDuration ¶
func EvaluateDuration(duration time.Duration, warning time.Duration) (status Status, message string)
EvaluateDuration is a shortcut for warning duration checks. It returns a message containing the duration, and a OK or a WARNING status depending on the provided warning duration.