Coder Social home page Coder Social logo

merlian / influxdb-zabbix Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zensqlmonitor/influxdb-zabbix

0.0 2.0 0.0 7.56 MB

Gather data from Zabbix back-end and load to InfluxDB in near real-time for enhanced performance and easier usage with Grafana.

License: MIT License

Go 79.57% Shell 20.43%

influxdb-zabbix's Introduction

influxdb-zabbix

Gather data from Zabbix back-end and load to InfluxDB in near real-time for enhanced performance and easier usage with Grafana.

As InfluxDB provides an excellent compression rate (in our case: 7x), this project could be used also to archive Zabbix data.

Getting Started

  • InfluxDB:

  • Grafana:

  • influxdb-zabbix:

  • PostgreSQL:

    Create user:

     CREATE USER influxdb_zabbix WITH PASSWORD '***';
     GRANT USAGE ON SCHEMA public TO influxdb_zabbix;

    Grants at the database level:

     GRANT SELECT ON public.history, public.history_uint TO influxdb_zabbix;
     GRANT SELECT ON public.trends, public.trends_uint TO influxdb_zabbix;

    Create indexes:

     CREATE UNIQUE INDEX idx_history_clock_ns_itemid
     	ON public.history USING btree (clock)
     	TABLESPACE zabbixindex;
    
     CREATE UNIQUE INDEX idx_history_uint_clock_ns_itemid
     	ON public.history_uint USING btree (clock)
     	TABLESPACE zabbixindex;
    
     CREATE INDEX idx_trends_clock_itemid
     	ON public.trends USING btree (clock)
     	TABLESPACE zabbixindex;
    
     CREATE INDEX idx_trends_uint_clock_itemid
     	ON public.trends_uint USING btree (clock)
     	TABLESPACE zabbixindex;
  • MariaDB / MySQL:

    Create user:

     CREATE USER 'influxdb_zabbix'@'localhost' IDENTIFIED BY '***';

    Grants at the database level:

     GRANT SELECT ON zabbix.trends TO influxdb_zabbix@localhost;
     GRANT SELECT ON zabbix.trends_uint TO influxdb_zabbix@localhost;
     GRANT SELECT ON zabbix.history TO influxdb_zabbix@localhost;
     GRANT SELECT ON zabbix.history_uint TO influxdb_zabbix@localhost;
     flush privileges;

    Create indexes:

     CREATE UNIQUE INDEX idx_history_clock_ns_itemid
     	ON history (clock) USING btree;
    
     CREATE UNIQUE INDEX idx_history_uint_clock_ns_itemid
     	ON history_uint (clock) USING btree;
    
     CREATE INDEX idx_trends_clock_itemid
     	ON trends (clock) USING btree;
    
     CREATE INDEX idx_trends_uint_clock_itemid
     	ON trends_uint (clock) USING btree;

    NB: For trends_* tables we can use pt-online-schema-change for online index create without lock, but for history_* tables we can only use create index, because primary key for these tables does not exist.

How to use GO code

  • Run in background: go run influxdb-zabbix.go &
  • Build in the current directory: go build influxdb-zabbix.go
  • Install in $GOPATH/bin: go install influxdb-zabbix.go

Goodies

Have a look to the scripts folder

Dependencies

Configuration: influxdb-zabbix.conf

  • PostgreSQL and MariaDB/MySQL supported.

  • Tables that can be replicated are:

    • history
    • history_uint
    • trends
    • trends_uint
  • Tables like history_log, _text and _str are not replicated.

  • Configurable at table-level:

    • interval: polling interval, minimum of 15 sec
    • hours per batch : number of hours/batch to extract from zabbix backend
    • output rows per batch : allow the destination load to be splitted in multiple batches

License

MIT-LICENSE. See LICENSE file provided in the repository for details

influxdb-zabbix's People

Contributors

banzayats avatar zensqlmonitor avatar

Watchers

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