No release in over 3 years
Low commit activity in last 3 years
There's a lot of open issues
This plugin provides native InfluxDB instrumentation for monitoring and metrics collection, including: service health via `/ping`, running queries, and service metrics.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
 Dependencies

Development

~> 1.7
~> 0.10
~> 12.3
~> 3.2
~> 3.1
~> 0.40.0
~> 0.8

Runtime

= 2.0.9
= 0.3.13
= 0.5.8
 Project Readme

Sensu-Plugins-influxdb

Build Status Gem Version Code Climate Test Coverage Dependency Status Sensu Bonsai Asset

Sensu Asset

The Sensu assets packaged from this repository are built against the Sensu ruby runtime environment. When using these assets as part of a Sensu Go resource (check, mutator or handler), make sure you include the corresponding Sensu ruby runtime asset in the list of assets needed by the resource. The current ruby-runtime assets can be found here in the Bonsai Asset Index.

Functionality

Files

  • bin/check-influxdb.rb
  • bin/check-influxdb-query.rb
  • bin/metrics-influxdb.rb
  • bin/mutator-influxdb-line-protocol.rb

Usage - metrics-influxdb.rb

Add the following to /etc/sensu/conf.d/influx.json "plugin expects influxdb to be a top level node in the json metrics-influxdb

{
    "influxdb": {
        "hosts"         : ["influxdb.familyguy.com"],
        "host"          : "influxdb.familyguy.com",
        "port"          : "8086",
        "username"      : "root",
        "password"      : "root",
        "database"      : "stats",
        # OPTIONAL
        "time_precision": "s",
        "use_ssl"       : false,
        "verify_ssl"    : true,
        "ssl_ca_cert"   : "path to the ca certificate file",
        "auth_method"   : "params",
        "initial_delay" : 0.01,
        "max_delay"     : 30,
        "open_timeout"  : 5,
        "read_timeout"  : 300,
        "retry"         : null,
        "prefix"        : "",
        "denormalize"   : true,
        "status"        : true
    }
}

Then add the following to your /etc/sensu/conf.d/handlers.json:

{
  "handlers": {
     "influx-tcp": {
       "type": "pipe",
       "command": "/opt/sensu/embedded/bin/metrics-influxdb.rb"
     }
   }
}

Setting "status" to true will store the metric using the status as the value and the check name as the series

Usage - mutator-influxdb-line-protocol.rb

Add the mutator-influxdb-line-protocol.rb file into /etc/sensu/extensions/

Then add the following to your /etc/sensu/conf.d/handlers.json:

{
  "handlers": {
    "influxdb_udp": {
      "type": "udp",
      "socket": {
        "host": "localhost",
        "port": 8090
      },
      "mutator": "influxdb_line_protocol"
    }
  }
}

Check configuration

To ship additional tags to your metrics via mutator-influxdb-line-protocol.rb (only available in influxdb >= 0.9), just add a tags block inside your check.

{
  "checks": {
    "cpu-metrics": {
      "command": "/opt/sensu/embedded/bin/metrics-cpu-pcnt-usage.rb",
      "handlers": [
        "influxdb_udp"
      ],
      "interval": 60,
      "subscribers": [
        "base"
      ],
      "type": "metric",
      "standalone": false,
      "tags": {
        "group": "operations"
      }
    }
  }
}

Installation

Installation and Setup

Notes