All Projects → sensu-plugins → sensu-plugins-mysql

sensu-plugins / sensu-plugins-mysql

Licence: MIT License
This plugin provides native MySQL instrumentation for monitoring and metrics collection, including: service health, database connectivity, `InnoDB` locks, replication status, metrics collection, and sending metrics to a MySQL database.

Programming Languages

ruby
36898 projects - #4 most used programming language

Projects that are alternatives of or similar to sensu-plugins-mysql

sensu-plugins-aws
This plugin provides native AWS instrumentation for monitoring and metrics collection, including: health and metrics for various AWS services, such as EC2, RDS, ELB, and more, as well as handlers for EC2, SES, and SNS.
Stars: ✭ 79 (+295%)
Mutual labels:  metrics, sensu-plugins
sensu-plugins-memory-checks
This plugin provides native memory instrumentation for monitoring and metrics collection, including: memory usage via `free` and `vmstat`, including metrics. Note that this plugin may have cross-platform issues.
Stars: ✭ 15 (-25%)
Mutual labels:  metrics, sensu-plugins
sensu-plugins-http
This plugin provides native HTTP instrumentation for monitoring and metrics collection, including: response code, JSON response, HTTP last modified, SSL expiry, and metrics via `curl`.
Stars: ✭ 31 (+55%)
Mutual labels:  metrics, sensu-plugins
resoto
Resoto - Find leaky resources, manage quota limits, detect drift, and clean up!
Stars: ✭ 562 (+2710%)
Mutual labels:  metrics
disent
🧶 Modular VAE disentanglement framework for python built with PyTorch Lightning ▸ Including metrics and datasets ▸ With strongly supervised, weakly supervised and unsupervised methods ▸ Easily configured and run with Hydra config ▸ Inspired by disentanglement_lib
Stars: ✭ 41 (+105%)
Mutual labels:  metrics
tellery
Tellery lets you build metrics using SQL and bring them to your team. As easy as using a document. As powerful as a data modeling tool.
Stars: ✭ 219 (+995%)
Mutual labels:  metrics
tsfeatures
Calculates various features from time series data. Python implementation of the R package tsfeatures.
Stars: ✭ 87 (+335%)
Mutual labels:  metrics
sonar-jdepend-plugin
Sonar plugin for jDepend
Stars: ✭ 22 (+10%)
Mutual labels:  metrics
ADPasswordHealth
A tool to evaluate the password health of Active Directory accounts.
Stars: ✭ 33 (+65%)
Mutual labels:  metrics
KafKare
A Kafka monitoring dashboard
Stars: ✭ 87 (+335%)
Mutual labels:  metrics
twitter-analytics-wrapper
A simple Python wrapper to download tweets data from the Twitter Analytics platform. Particularly interesting for the impressions metrics that are unavailable on current Twitter API. Also works for the videos data.
Stars: ✭ 44 (+120%)
Mutual labels:  metrics
chia-monitor
🍃 A comprehensive monitoring and alerting solution for the status of your Chia farmer and harvesters.
Stars: ✭ 131 (+555%)
Mutual labels:  metrics
Hystrix.Dotnet
A combination of circuit breaker and timeout. The .net version of the open source Hystrix library built by Netflix.
Stars: ✭ 88 (+340%)
Mutual labels:  metrics
node-tesla-data
App which pulls and stores Tesla data in a MySQL database
Stars: ✭ 28 (+40%)
Mutual labels:  metrics
phpstats
CLI Statistics and dependency graphs for PHP
Stars: ✭ 61 (+205%)
Mutual labels:  metrics
auth0-instrumentation
The goal of this package is to make it easier to collect information about our services through logs, metrics and error catching.
Stars: ✭ 18 (-10%)
Mutual labels:  metrics
docker-jmx-prometheus-exporter
Dockerized jmx-exporter for prometheus
Stars: ✭ 24 (+20%)
Mutual labels:  metrics
druid-prometheus-exporter
Service to collect Apache Druid metrics and export them to Prometheus
Stars: ✭ 14 (-30%)
Mutual labels:  metrics
emq exporter
Simple server that scrapes EMQ metrics and exporters them via HTTP for Prometheus consumption
Stars: ✭ 31 (+55%)
Mutual labels:  metrics
rust-statsd-server
A statsd server implemented in Rustlang
Stars: ✭ 16 (-20%)
Mutual labels:  metrics

Sensu-Plugins-mysql

Build Status Gem Version Code Climate Test Coverage Dependency Status

Functionality

Files

  • bin/check-cloudwatch-mysql-sensu.rb
  • bin/check-mysql-alive.rb
  • bin/check-mysql-status.rb
  • bin/check-mysql-connections.rb
  • bin/check-mysql-disk.rb
  • bin/check-mysql-innodb-lock.rb
  • bin/check-mysql-threads.rb
  • bin/check-mysql-query-result-count.rb
  • bin/check-mysql-select-count.rb
  • bin/check-mysql-msr-replication-status.rb
  • bin/metrics-mysql-graphite.rb
  • bin/metrics-mysql-multiple-select-count.rb
  • bin/metrics-mysql-processes.rb
  • bin/metrics-mysql-raw.rb
  • bin/metrics-mysql.rb
  • bin/metrics-mysql-query-result-count.rb
  • bin/metrics-mysql-select-count.rb
  • bin/mysql-metrics.sql

Usage

metrics-mysql

{
    "mysql":{
        "hostname": "localhost",
        "username": "sensu_user",
        "password": "sensu_user_pass"
    }
}

metrics-mysql-graphite example:

/opt/sensu/embedded/bin$ /opt/sensu/embedded/bin/ruby metrics-mysql-graphite.rb --host=localhost --port=3306 --user=collectd --pass=tflypass --socket=/data/mysql.sock

check-mysql-connections example

/opt/sensu/embedded/bin$ /opt/sensu/embedded/bin/ruby check-mysql-connections.rb --host=localhost --port=3306 --user=collectd --pass=tflypass --socket=/data/mysql.sock

check-mysql-connections example with ini file to hide credentials

$ /opt/sensu/embedded/bin/check-mysql-connections.rb --host=<DBHOST> --ini=/etc/sensu/my.ini

check-mysql-alive example

$ /opt/sensu/embedded/bin/check-mysql-alive.rb --host=<DBHOST> --ini=/etc/sensu/my.ini --ini-section=customsection

check-mysql-disk example (note: you must supply max disk size)

$ /opt/sensu/embedded/bin/check-mysql-disk.rb --host=<DBHOST> --ini=/etc/sensu/my.ini --size <MAX_DB_SIZE>

check-mysql-innodb-lock example

$ /opt/sensu/embedded/bin/check-mysql-innodb-lock.rb --host=<DBHOST> --ini=/etc/sensu/my.ini

check-mysql-threads example

$ /opt/sensu/embedded/bin/check-mysql-threads.rb --host=<DBHOST> --ini=/etc/sensu/my.ini --warnlow 0

check-mysql-replication-status example

$ /opt/sensu/embedded/bin/check-mysql-replication-status.rb --host=<SLAVE> --ini=/etc/sensu/my.ini

check-mysql-msr-replication-status example

$ /opt/sensu/embedded/bin/check-mysql-replication-status.rb --host=<SLAVE> --ini=/etc/sensu/my.ini

check-mysql-query-result-count example

/opt/sensu/embedded/bin$ /opt/sensu/embedded/bin/ruby check-mysql-query-result-count.rb --host=localhost --port=3306 --user=collectd --pass=tflypass --socket=/data/mysql.sock --warning 1 --critical 10 --query 'SELECT DISTINCT(t.id) FROM table t where t.failed = true'

check-mysql-select-count example

/opt/sensu/embedded/bin$ /opt/sensu/embedded/bin/ruby check-mysql-select-count.rb --host=localhost --port=3306 --user=collectd --pass=tflypass --socket=/data/mysql.sock --warning 30000 --critical 50000 --query 'SELECT count(*) FROM table t'

metrics-mysql-query-result-count example

/opt/sensu/embedded/bin$ /opt/sensu/embedded/bin/ruby metrics-mysql-query-result-count.rb --host=localhost --port=3306 --user=collectd --pass=tflypass --socket=/data/mysql.sock --query 'SELECT DISTINCT(t.id) FROM table t where t.failed = true'

metrics-mysql-select-count example

/opt/sensu/embedded/bin$ /opt/sensu/embedded/bin/ruby metrics-mysql-select-count.rb --host=localhost --port=3306 --user=collectd --pass=tflypass --socket=/data/mysql.sock --query 'SELECT COUNT(*) FROM table t'

metrics-mysql-multiple-select-count example

/opt/sensu/embedded/bin$ /opt/sensu/embedded/bin/metrics-mysql-multiple-select-count.rb --host=localhost --port=3306 --user=collectd --pass=tflypass --socket=/data/mysql.sock --query '{"t1_count":"SELECT COUNT(*) FROM table t1", "t2_count":"SELECT COUNT(*) FROM table t2"}'

Security

In keeping with the principle of least privilege you should create a new user with the minimum required permissions. See the table below for minimum permissions for each check.

Check Permissions
check-mysql-alive.rb SELECT
check-mysql-connections.rb SELECT
check-mysql-disk.rb SELECT
check-mysql-innodb-lock.rb PROCESS
check-mysql-query-result-count.rb depends on query
check-mysql-select-count.rb SELECT
check-mysql-replication-status.rb SUPER OR REPLICATION_CLIENT (the latter is preferable)
check-mysql-msr-replication-status.rb SELECT
check-mysql-status.rb SELECT
check-mysql-threads.rb SELECT
metrics-mysql-graphite.rb SELECT
metrics-mysql-processes.rb SELECT
metrics-mysql-query-result-count.rb depends on query
metrics-mysql-select-count.rb   depends on query                                        
metrics-mysql-multiple-select-count   depends on query                                        
metrics-mysql-raw.rb SELECT
metrics-mysql.rb INSERT into sensumetrics.sensu_historic_metrics

I would recommend using different users when you need to have more than RO access (REPLICATION_CLIENT or using the metrics handler) to limit the potential ramifications of that user being compromised.

Installation

Installation and Setup

Notes

The ruby executables are install in path similar to /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/sensu-plugins-mysql-0.0.4/bin

Troubleshooting

When used in chef, if the dependencies are missing, an error may abort the chef-client run:

*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

This may be fixed by installing the mysql client library before the plugin:

# http://serverfault.com/questions/415392/install-mysql-gem-for-use-in-chef-client
package "libmysqlclient-dev" do
  action :install
end

sensu_gem 'sensu-plugins-mysql' do version '0.0.4' end
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].