ping

package
v0.50.0 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2023 License: GPL-3.0 Imports: 9 Imported by: 0

README

Ping monitoring with Netdata

This module measures round-tripe time and packet loss by sending ping messages to network hosts.

Requirements

There are two operational modes:

  • privileged (send raw ICMP ping, default). Requires CAP_NET_RAW capability or root privileges:

    Note: set automatically during Netdata installation.

    sudo setcap CAP_NET_RAW=eip <INSTALL_PREFIX>/usr/libexec/netdata/plugins.d/go.d.plugin
    
  • unprivileged (send UDP ping, Linux only). Requires configuring ping_group_range:

    sudo sysctl -w net.ipv4.ping_group_range="0 2147483647"
    

    To persist the change add net.ipv4.ping_group_range="0 2147483647" to /etc/sysctl.conf and execute sudo sysctl -p.

The mode can be changed in the module configuration file.

Metrics

All metrics have "ping." prefix.

Labels per scope:

  • host: host.
Metric Scope Dimensions Units
host_rtt host min, max, avg milliseconds
host_std_dev_rtt host std_dev milliseconds
host_packet_loss host loss percentage
host_packets host received, sent packets

Configuration

Edit the go.d/ping.conf configuration file using edit-config from the Netdata config directory, which is typically at /etc/netdata.

cd /etc/netdata # Replace this path with your Netdata config directory
sudo ./edit-config go.d/ping.conf

Here is an example configuration:

jobs:
  - name: example
    hosts:
      - 192.0.2.0
      - 192.0.2.1
      - example.com
    packets: 5       # number of ping packets to send.
    interval: 200ms  # time to wait between sending ping packets.

For all available options please see module configuration file.

Troubleshooting

To troubleshoot issues with the ping collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

First, navigate to your plugins' directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the setting plugins directory. Once you're in the plugin's directory, switch to the netdata user.

cd /usr/libexec/netdata/plugins.d/
sudo -u netdata -s

You can now run the go.d.plugin to debug the collector:

./go.d.plugin -d -m ping

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	UpdateEvery int          `yaml:"update_every"`
	Hosts       []string     `yaml:"hosts"`
	Privileged  bool         `yaml:"privileged"`
	SendPackets int          `yaml:"packets"`
	Interval    web.Duration `yaml:"interval"`
}

type Ping

type Ping struct {
	module.Base
	Config `yaml:",inline"`
	// contains filtered or unexported fields
}

func New

func New() *Ping

func (*Ping) Charts

func (p *Ping) Charts() *module.Charts

func (*Ping) Check

func (p *Ping) Check() bool

func (*Ping) Cleanup

func (p *Ping) Cleanup()

func (*Ping) Collect

func (p *Ping) Collect() map[string]int64

func (*Ping) Init

func (p *Ping) Init() bool

Jump to

Keyboard shortcuts

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