ping

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: BSD-3-Clause Imports: 7 Imported by: 0

README

ping plugin

This plugin send a ping.

Warn: This plugin will keep running until the count is done

Configuration

Fields Description
hostname ping destination
count number of ping you want execute
interval_second interval between two pings

Example

An action of type ping requires the following kind of configuration:

action:
  type: ping
  configuration:
    # mandatory, string
    hostname: example.org
    # mandatory, string as uint
    count: "2"
    # mandatory, string as uint
    interval_second: "1"

Note

The plugin returns two objects, the Output to fetch statistics about ping(s):

{
  "packets_received":1,
  "packets_sent":1,
  "packet_loss": 0.00,
  "ip_addr":"192.168.0.1",
  "rtts":"1s",
  "min_rtt":"1se",
  "max_rtt":"1s",
  "avg_rtt":"1s",
  "std_dev_rtt":"1s"
}

The Metadata to reuse the parameters in a future component:

{
  "hostname":"example.org",
  "count":"2",
  "interval_second": "1"
}

Resources

The ping plugin declares automatically resources for its steps:

  • socket to rate-limit concurrent execution on the number of open outgoing sockets
  • url:hostname (where hostname is the ping destination host of the plugin configuration) to rate-limit concurrent execution on a specific destination host

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Plugin = taskplugin.New("ping", "0.1", exec,
		taskplugin.WithConfig(validConfig, Config{}),
		taskplugin.WithResources(resourcesping),
	)
)

the ping plugin send ping

Functions

This section is empty.

Types

type Config

type Config struct {
	Hostname string `json:"hostname"`
	Count    string `json:"count,omitempty"`
	Interval string `json:"interval_second,omitempty"`
}

Config is the configuration needed to send a ping

Jump to

Keyboard shortcuts

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