Giter Club home page Giter Club logo

statsd-zabbix-backend's Introduction

StatsD Zabbix backend Build Status

Backend for StatsD to publish stats to Zabbix.

Table of Contents generated with DocToc

Installation

Tested with Node 6+.

npm install statsd-zabbix-backend

Configuration

Example StatsD configuration:

{
  debug: true,
  flushInterval: 10000,
  percentThreshold: [95, 99],
  backends: ["statsd-zabbix-backend"],
  zabbixHost: "zabbix.example.com",
}

Options

  • zabbixHost: Hostname or IP for Zabbix server [default: localhost]
  • zabbixPort: Port for Zabbix server [default: 10051]
  • zabbixSendTimestamps: Send timestamps to Zabbix, otherwise [default: false]
  • zabbixTargetHostname: Set static hostname, use full stat as key [default: undefined]

Usage

This plugin is primarily designed for use with logstash > statsd > zabbix pipline, but should work for getting data from any source into Zabbix.

Zabbix

All Zabbix items are expected to be type Zabbix trapper to support receiving push data.

Most values should be decimal. Average (avg) or mean values should be float.

Stat Names

Send your host and key separated by an underscore, for example:

host.example.com_my.key:1|c

Stats starting with any of the following prefixes will be handled differently:

  • logstash.
  • kamon.
  • statsd.

Static Hostname

If you run statsd on each host, set option zabbixTargetHostname to send all stats to a single host. In this mode, the full stat name will be used as the item key in Zabbix.

Logstash

Logstash's statsd output sends data in the format namespace.sender.metric.

  • namespace: default is "logstash"
  • sender: default is "%{host}", replacing dots with underscores
  • metric: name of the metric used in increment

See Logstash examples for specific keys Zabbix will receive based on metric type.

Note: sender and metric will have underscores replaced by periods before being sent to Zabbix.

Counters

Logstash statsd output using increment:

{
  statsd {
    host => "127.0.0.1"
    increment => ["my_key"]
  }
}

Logstash sends to Statsd: logstash.host_example_com.my_key:1|c.

Statsd calculates 2 values every flushInterval and sends each as a separate key to Zabbix for host "host.example.com":

  • my.key[avg]
  • my.key[total]

Timers

Logstash statsd output using timing:

{
  statsd {
    host => "127.0.0.1"
    timing => {
      "my_key" => "1"
    }
  }
}

Logstash sends to Statsd: logstash.host_example_com.my_key:1|ms

Given the percentThreshold in the example Statsd config, each of the following values would be calculated every flushInterval and sent as a separate keys to Zabbix for host "host.example.com":

  • my.key[mean][95]
  • my.key[upper][95]
  • my.key[mean][99]
  • my.key[upper][99]
  • my.key[upper]
  • my.key[lower]
  • my.key[count]

Gauges

Gauges are also supported.

{
  statsd {
    host => "127.0.0.1"
    gauge => {
      "my_key" => "1"
    }
  }
}

Logstash sends to Statsd: logstash.host_example_com.my_key:1|g

Zabbix will receive a single item:

  • my.key

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.