probers

package
v0.0.0-...-65de9fb Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TLSConf

type TLSConf struct {
	Hostname string `yaml:"hostname"`
	RootOrg  string `yaml:"rootOrg"`
	RootCN   string `yaml:"rootCN"`
	Response string `yaml:"response"`
}

TLSConf is exported to receive YAML configuration.

func (TLSConf) Instrument

func (c TLSConf) Instrument() map[string]prometheus.Collector

Instrument constructs any `prometheus.Collector` objects the `TLSProbe` will need to report its own metrics. A map is returned containing the constructed objects, indexed by the name of the Promtheus metric. If no objects were constructed, nil is returned.

func (TLSConf) Kind

func (c TLSConf) Kind() string

Kind returns a name that uniquely identifies the `Kind` of `Configurer`.

func (TLSConf) MakeProber

func (c TLSConf) MakeProber(collectors map[string]prometheus.Collector) (probers.Prober, error)

MakeProber constructs a `TLSProbe` object from the contents of the bound `TLSConf` object. If the `TLSConf` cannot be validated, an error appropriate for end-user consumption is returned instead.

func (TLSConf) UnmarshalSettings

func (c TLSConf) UnmarshalSettings(settings []byte) (probers.Configurer, error)

UnmarshalSettings takes YAML as bytes and unmarshals it to the to an TLSConf object.

type TLSProbe

type TLSProbe struct {
	// contains filtered or unexported fields
}

TLSProbe is the exported `Prober` object for monitors configured to perform TLS protocols.

func (TLSProbe) Kind

func (p TLSProbe) Kind() string

Kind returns a name that uniquely identifies the `Kind` of `Prober`.

func (TLSProbe) Name

func (p TLSProbe) Name() string

Name returns a string that uniquely identifies the monitor.

func (TLSProbe) Probe

func (p TLSProbe) Probe(timeout time.Duration) (bool, time.Duration)

Probe performs the configured TLS probe. Return true if the root has the expected Subject (or if no root is provided for comparison in settings), and the end entity certificate has the correct expiration status (either expired or unexpired, depending on what is configured). Exports metrics for the NotAfter timestamp of the end entity certificate and the reason for the Probe returning false ("none" if returns true).

Jump to

Keyboard shortcuts

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