Giter VIP home page Giter VIP logo

mysql-to-influxdb's Introduction

Mysql-to-influxdb

Quick hack to get data from MySQL into influx db to display with Graphite and Grafana. This is a quick script I created for a very specific use case so it won't copy your whole database over magically. If you need this you can modify the script to fit your needs.

This script will meant to run constantly or one time and send data from a single table in MYSQL to influx. If you have multiple tables this will be an issue. Also it requires that the MYSQL table is altered to have a specific column which indicates whether this piece of data has been copied to influx already or not.

Log

2020/10/08: Python 3 and replace Mysql-Python

Config

This script needs a config file to run simply create config file. Below is a samle config file for settings.ini

[mysql]
host : mysql_server_hostname
port : mysql_server_port # Default is3306
username : mysql_user_name
password : mysql_user_password
db : mysql_database
table : mysql_table
check_field : column_to_check_if_data_has_been_transferred
time_field : colum_that_contains_timestam_in_table
siteid_field : column_which_contains_site_id_tag


[influx]
host : localhost
port : 8086
username : influx_username
password : influx_pass
db : sesh

[server]
interval : 5 

[site_info]
site_name : tag_name_to_append_to_all_data_going_into_influx

Usage

first run pip install -r requirements.txt then python mysql2influx.py -d -c settings.ini -s

This will run the script as a server in debug mode

mysql-to-influxdb's People

Contributors

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