Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

sensu-plugins-mysql-nagyt

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sensu-plugins-mysql-nagyt

  • 2.6.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

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-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'

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.

CheckPermissions
check-mysql-alive.rbSELECT
check-mysql-connections.rbSELECT
check-mysql-disk.rbSELECT
check-mysql-innodb-lock.rbPROCESS
check-mysql-query-result-count.rbdepends on query
check-mysql-select-count.rbSELECT
check-mysql-replication-status.rbSUPER OR REPLICATION_CLIENT (the latter is preferable)
check-mysql-msr-replication-status.rbSELECT
check-mysql-status.rbSELECT
check-mysql-threads.rbSELECT
metrics-mysql-graphite.rbSELECT
metrics-mysql-processes.rbSELECT
metrics-mysql-query-result-count.rbdepends on query
metrics-mysql-select-count.rb  depends on query                                        
metrics-mysql-raw.rbSELECT
metrics-mysql.rbINSERT 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

FAQs

Package last updated on 20 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc