pingbeat

command module
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2016 License: Apache-2.0 Imports: 3 Imported by: 0

README

pingbeat

You know, for pings

pingbeat sends ICMP pings to a list of targets and stores the round trip time (RTT) in Elasticsearch (or elsewhere). It uses tatsushid/go-fastping for sending/recieving ping packets and elastic/libbeat to talk to Elasticsearch and other outputs. Essentially, those two libraries do all the heavy lifting, pingbeat is just glue around them.

Requirements

pingbeat has the same requirements around the Go environment as libbeat, see here.

Installation

Install and configure Go.

Install and update this go package with:

go get -u github.com/joshuar/pingbeat

The pingbeat binary will then be available in $GOPATH/bin.

If intending on using the Elasticsearch output, you should add a new index template using the supplied one, for example with:

curl -XPUT  /_template/pingbeat -d @/path/to/pingbeat.template.json

Usage

See the example configuration file for configuring your targets and assigning an output (default output is Elasticsearch).

There is a Kibana export you can use to create some basic visulisations and a simple dashboard to explore pingbeat data.

Once you've created a configuration file you can run pingbeat with:

pingbeat -c /path/to/beat.yml

To run Pingbeat with debugging output enabled, run:

./pingbeat -c pingbeat.yml -e -d "*"

Note on privileges

In order to send regular ICMP ping packets, pingbeat needs to open raw sockets, which can only be done with superuser privileges. So you either need to run pingbeat with sudo or as root to send regular pings. If you don't want to do that, set privileged: false in your config and run pingbeat as a regular user. It will then use a UDP ping to test connectivity.

Alternatively, on Linux you can grant pingbeat access to raw sockets without the need to run with sudo or as root user, by granting the binary CAP_NET_RAW capability (see: capabilities; for overview of Linux capabilities). To set necessary capability, ensure that the getcap and setcap binaries are present (you might need to install relevant packages from you distribution) in your PATH, then execute the following: setcap cap_net_raw+ep <PATH> where PATH is the location where the pingbeat binary was installed; to verify execute the following: getcap <PATH>. Given that everything went well, the output from getcap should indicate that pingbeat has now cap_net_raw+ep capabilities set.

License

pingbeat is licensed under the Apache 2.0 license.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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