0.9.0 • Published 6 years ago

statsd-zabbix-backend v0.9.0

Weekly downloads
23
License
MIT
Repository
github
Last release
6 years ago

StatsD Zabbix backend

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

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
0.9.0

6 years ago

0.2.0

8 years ago

0.1.3

10 years ago

0.1.2

11 years ago

0.1.1

11 years ago

0.1.0

12 years ago