Giter VIP home page Giter VIP logo

influxdb-nagios-plugin's Introduction

influxdb-nagios-plugin

InfluxDB Nagios Plugin

Uses the excellent nagiosplugin project to create measurement-based Nagios checks using InfluxDB.

Build Status

Queries

The plugin issues InfluxDB queries in a few differnt forms based on command line input.

The most common of these (and the query that the tool is built-around) is define by the single sub-command; it will issue a query of the form:

SELECT time, value FROM <measurement> WHERE time > now() - <age> AND host = '<hostname>'

The plugin then validates that there are a sufficient number of results and that the mean of these measurements are within acceptable bounds.

This model works well with Telegraf in which healthy hosts will emit specific measurements regularly. Many of the plugin's defaults are optimized for this use case.

In 0.10.x, Telegraf changed their model from having point measurements (time, value) to to collections (time, value, value2). That is, previously there would be mulitple series such as cpu_usage_nice and cpu_usage_system, each containing only (time, value) pairs. In new model, the series cpu would contain (time, usage_nice, usage_system).

Installation

Use pip:

pip install influxdbnagiosplugin

Usage

Usage: check-measurement [OPTIONS] COMMAND1 [ARGS]...

Command line entry point. Defines common arguments.

Options:
  -v, --verbose
  --hostname TEXT             InfluxDB hostname
  --port INTEGER              InfluxDB port
  --username TEXT             InfluxDB usernanme
  --password TEXT             InfluxDB password
  --database TEXT             InfluxDB database name
  --count-error-range TEXT    Range of measurement counts that are NOT
							  considered an error
  --count-warning-range TEXT  Range of measurement counts that are NOT
							  considered a warning
  --mean-error-range TEXT     Range of measurement means that are NOT
							  considered an error
  --mean-warning-range TEXT   Range of measurement counts that are NOT
							  considered a warning
  --timeout INTEGER           Timeout in seconds for connecting to InfluxDB
  --help                      Show this message and exit.

Commands:
  query   Run an explicit query.
  single  Run a query for a single measurement.

check-measurement [OPTIONS] single [OPTIONS] MEASUREMENT HOSTNAME

  Run a query for a single measurement.

Options:
  --age TEXT
  --where TEXT  Extra where conditions to include.
  --field TEXT
  --help        Show this message and exit.


Usage: check-measurement query [OPTIONS] QUERY

  Run an explicit query.

Options:
  --help  Show this message and exit.

influxdb-nagios-plugin's People

Contributors

vincer avatar stephen-kwong avatar jessemyers avatar

Watchers

Oliver Burkill 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.