ping

package
v0.55.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2023 License: GPL-3.0 Imports: 10 Imported by: 0

README

Ping collector

Overview

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

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.

Collected metrics

Metrics grouped by scope.

The scope defines the instance that the metric belongs to. An instance is uniquely identified by a set of labels.

host

These metrics refer to the remote host.

Labels:

Label Description
host remote host

Metrics:

Metric Dimensions Unit
ping.host_rtt min, max, avg milliseconds
ping.host_std_dev_rtt std_dev milliseconds
ping.host_packet_loss loss percentage
ping.host_packets received, sent packets

Setup

Prerequisites

No action required.

Configuration
File

The configuration file name is go.d/ping.conf.

The file format is YAML. Generally, the format is:

update_every: 1
autodetection_retry: 0
jobs:
  - name: some_name1
  - name: some_name1

You can edit the configuration file using the edit-config script from the Netdata config directory.

cd /etc/netdata 2>/dev/null || cd /opt/netdata/etc/netdata
sudo ./edit-config go.d/ping.conf
Options

The following options can be defined globally: update_every, autodetection_retry.

Config options
Name Description Default Required
update_every Data collection frequency. 5
autodetection_retry Re-check interval in seconds. Zero means not to schedule re-check. 0
hosts Network hosts. yes
privileged Ping packets type. "no" means send an "unprivileged" UDP ping, "yes" - raw ICMP ping. yes
packets Number of ping packets to send. 5
interval Timeout between sending ping packets. 100ms
Examples
IPv4 hosts

An example configuration.

Config
jobs:
  - name: example
    hosts:
      - 192.0.2.0
      - 192.0.2.1
Unprivileged mode

An example configuration.

Config
jobs:
  - name: example
    privileged: no
    hosts:
      - 192.0.2.0
      - 192.0.2.1
Multi-instance

Note: When you define multiple jobs, their names must be unique.

Multiple instances.

Config
jobs:
  - name: example1
    hosts:
      - 192.0.2.0
      - 192.0.2.1

  - name: example2
    packets: 10
    hosts:
      - 192.0.2.3
      - 192.0.2.4

Troubleshooting

Debug mode

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.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
    
  • Switch to the netdata user.

    sudo -u netdata -s
    
  • 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"`
	Interface   string       `yaml:"interface"`
}

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