Code Monkey home page Code Monkey logo

sensu-mysql-metrics's Introduction

Sensu Mysql Metrics

Golang sensu/graphite plugin to get all metrics from mysql 'show global status'

Why new plugin

I'm sick of ruby plugins that require a lot of dependiences, so I made my script in goLang to get all variables from mysql show global status to sensu (and then to graphite).

You are high-school "developer" that doesn't know what is golang

Yep, It's my first Go program, so it's not the nicest - but it works

Compile and usage

Compile is simple:

go build sensu-mysql-metrics.go

Usage is even simpler:

./sensu-mysql-metrics -username="monitoring" -password="some_password"

For more options just use

./sensu-mysql-metrics --help

Example sensu file:

{
  "checks": {
    "mysql_graphite_metrics": {
      "type": "metric",
      "command": "sensu-mysql-metrics -host=':::mysql.host:::' -port=':::mysql.port:::' -username=':::mysql.user:::' -password=':::mysql.password:::'",
      "interval": 60,
      "subscribers": ["mysql"],
      "handlers": ["relay"]
    }
  }
}

and just add the config variables on client:

    "mysql": {
      "host": "localhost",
      "port": 3306,
      "user": "monitoring",
      "password": "some_password"
    }

Known issue

If the mysql parameters are wrong there is an error:

panic: runtime error: invalid memory address or nil pointer dereference

Will fix it in my free time

sensu-mysql-metrics's People

Contributors

marek-knappe avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

vonwenm

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.