Giter VIP home page Giter VIP logo

infping's Introduction

Introduction

infping is a simple Go program to parse the output of fping and store it in InfluxDB. Based upon software by Tor Hveem.

Configuration

This program uses the Viper configuration package and can process configuration files in JSON, YAML, TOML, and others. Save your configuration file as infping.<json|yaml|toml|...> in /etc/, /usr/local/etc, or the program directory. A sample configuration file is provided in JSON format.

influx

  • host: The hostname to connect to
  • port: The TCP port number
  • user: The username, if needed
  • pass: The password, if needed
  • db: The database name to connect to โ€“ this will be created if it does not exist
  • secure: Set to true to enable HTTPS

fping

  • backoff: The value for the -B argument
  • retries: The value for the -r argument
  • tos: The value for the -O argument
  • summary: The value for the -Q argument โ€“ this determines how often data is collected
  • period: The value for the -p argument

hosts

  • hosts: An array of hostnames to ping

Influx Storage

Data is stored in Influx with the following fields and tags:

  • min: field showing minimum ping time during the run
  • max: field showing maximum ping time during the run
  • avg: field showing average ping time during the run
  • loss: field showing packet loss during the run
  • rx_host: tag showing the target host
  • tx_host: tag showing the originating host of the ping check

Docker

There is a beta-quality Dockerfile in the root of this repo that uses multistage builds to build and create an image of infping. Running it can be as easy as:

docker run -v /local/infping.json:/config/infping.json $IMAGE

It will automatically detect the configuration in /config. For best results, assign a hostname, otherwise you'll end up with one that doesn't make much sense

Grafana Dashboard

A sample Grafana dashboard is included, that plots all four of the collected ping statistics in something approximating the display of Smokeping. Simply create a datasource named "infping" pointing to Influx, and then import this dashboard. The hostname variable will be automatically populated with all the host names found in the database, and can be used to select different graphs.

dashboard screenshot

infping's People

Contributors

dsshwamzn avatar imkwx avatar jplitza avatar miken32 avatar nickvanw avatar torhve avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.