GithubHelp home page GithubHelp logo

duanshuaimin / zabbix-impersonator Goto Github PK

View Code? Open in Web Editor NEW

This project forked from app-sre/zabbix-impersonator

0.0 1.0 0.0 2.13 MB

zabbix to prometheus adapter

Go 91.35% Makefile 6.13% Dockerfile 0.99% Shell 1.52%
zabbix-prometheus zabbix prometheus

zabbix-impersonator's Introduction

Zabbix Impersonator

Overview

This is a go server that implements the zabbix sender protocol [1] [2].

It listens on two ports:

  • TCP port 10051 to listen to zabbix_sender requests.
  • HTTP /metrics port 2112 to expose the Prometheus metrics.

The server is configured by a metrics.json file that contains the allowed zabbix metrics. All zabbix_sender requests received by the server that have a matching entry in metrics.json will be exposed via the /metrics interface on port 2112. All other metrics will be ignored.

Demo

demo

metrics.json

The metrics.json file is an array of metrics that will be accepted by the server. Each metric supports the following arguments:

  • zabbix_key: (mandatory) key name sent by the zabbix client. It corresponds to the key name defined in this document. The parameters section (including the square brackets) must not appear in this field.
  • metric: (optional) the name of the metric as exposed by the Prometheus client. If not defined, it will default to zabbix_<sanitized_key_name> (where the sanitized_key_name is the key_name after replacing all . occurrences with _).
  • help: (optional) help string for the metric exposed by the Prometheus client.
  • args: (optional) array of parameters as defined in this document. If defined the zabbix client must send the metric with the parameters (including the square bracket) otherwise it will be skipped. This arguments will be defined as labels in the Prometheus metrics.

Limitations

  • The only metric kind currently supported is a GaugeVec.
  • All values are parsed as float64.
  • The Clock value for a trapper item is ignored.
  • By design it only supports trapper items.

Internal Prometheus metrics

  • processed_requests: (counter) total number of processed zabbix_sender requests
  • invalid_requests: (counter) total number of invalid zabbix_sender requests
  • processed_trapper_items: (counter) total number of processed trapper items
  • skipped_trapper_items: (counter) total number of skipped trapper items

Future enhancements

  • Add configuration file / cli parameters: zabbix host, port, zabbix server port, metrics json file path, etc.
  • Add a cache for unknown metrics in order to expose them via internal prometheus metrics.
  • Better logging.

zabbix-impersonator's People

Contributors

jfchevrette avatar jmelis 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.