network

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: MIT Imports: 8 Imported by: 0

README

Network plugin

The network plugin provides checks for low-level network services.

Checks

network.connect
check network.connect "example" {
  address = "hostname:1234"
  network = "tcp6"
}

Attempts to open a network connection to the given address. Addresses must be in the form "host:port", "host%zone:port", "[host]:port" or "[host%zone]:port".

By default, connection attempts will be made over TCP (IPv6 or IPv4 using Fast Fallback). If the network parameter is included then connection attempts will be limited to that network. Valid options are: "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6".

network.portscan
check network.portscan "example" {
  address = "hostname"
  network = "tcp6"

  start = 1
  end = 1024
  allow = [80, 443]

  concurrent_connections = 100
  connection_timeout = 3s
}

Performs a scan of all ports from start to end inclusive on the given address. Fails if any ports are open except those in the allow parameter.

If the target does not respond, connection attempts will be terminated after the connection_timeout elapses and the port treated as closed.

To improve speed, the check runs many connection attempts in parallel. This can be controlled with the concurrent_connections parameter.

By default, connection attempts will be made over TCP (IPv6 or IPv4 using Fast Fallback). If the network parameter is included then connection attempts will be limited to that network. Valid options are: "tcp", "tcp4", "tcp6", "udp", "udp4", "udp6".

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConnectCheck

type ConnectCheck struct {
	Network string
	Address string
}

func (ConnectCheck) Execute

func (c ConnectCheck) Execute(ctx context.Context) goplum.Result

func (ConnectCheck) Validate

func (c ConnectCheck) Validate() error

type Plugin

type Plugin struct{}

func (Plugin) Alert

func (p Plugin) Alert(kind string) goplum.Alert

func (Plugin) Check

func (p Plugin) Check(kind string) goplum.Check

type PortScanCheck

type PortScanCheck struct {
	Network string
	Address string

	Start int
	End   int
	Allow []int

	ConcurrentConnections int           `config:"concurrent_connections"`
	ConnectionTimeout     time.Duration `config:"connection_timeout"`
}

func (PortScanCheck) Execute

func (c PortScanCheck) Execute(ctx context.Context) goplum.Result

func (PortScanCheck) Timeout

func (c PortScanCheck) Timeout() time.Duration

func (PortScanCheck) Validate

func (c PortScanCheck) Validate() error

Jump to

Keyboard shortcuts

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