sensu-plugins-mysql 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7b7608ea6a5cded48a747cf06209077fe26e9041
4
- data.tar.gz: 9f7cdbab6faede729fe2d3784f55a9056a7e2bad
3
+ metadata.gz: 0b486ab1f37f22a717a6f7cbe8a571a82538ba90
4
+ data.tar.gz: f39d9d67e8575e3137b037603404e7a72cb27fda
5
5
  SHA512:
6
- metadata.gz: dbfcc07febf6c3fd280f2ac82765162037d977bf153e68dce1711f3607157cd6ef5ee2dbca82b39a1e6ddc5d76d9bfbde7f7c1f47f0f8b0d596863426f89c4e1
7
- data.tar.gz: 8e794b4cce853c315b3add749195e8fc6318f6403eae8a5bdc02420cfeac31ea2083d1ad52a12790dfcd7e21fcbe86a3085c4075a89310efac503eeb80e7f756
6
+ metadata.gz: fa7b759b755510fd75a664d5fcc79a4d5f801416afe98e3c7b30364b161061d0dfbc729083e36b16c0f7c2ced36d7da468c40c396770147d9abf81346352f3e3
7
+ data.tar.gz: e5dae69ae37eea727d9971245874e3445d843d117ec02c2f86624f2a088b82825cf7250e50b36af334fcc812ba6a5c81dddba6fc381678cdb7e1accffe7aa8a0
data/CHANGELOG.md CHANGED
@@ -4,6 +4,17 @@ This project adheres to [Semantic Versioning](http://semver.org/).
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
+
8
+ ## [2.1.1] - 2017-06-25
9
+ ### Added
10
+ - Added minimum viable permissions in `README` for all the checks, metrics, and handlers. (@majormoses)
11
+
12
+ ### Fixed
13
+ - check-mysql-disk.rb: make required options required. (@majormoses)
14
+
15
+ ### Changed
16
+ - check-mysql-disk.rb: misc changes on where option output is cast. (@majormoses)
17
+
7
18
  ## [2.1.0] - 2017-06-10
8
19
  ### Added
9
20
  - metrics-mysql-query-result-count.rb: Creates a graphite-formatted metric for the length of a result set from a MySQL query. (@athal7)
@@ -71,7 +82,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
71
82
  ### Added
72
83
  - initial release
73
84
 
74
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.1.0...HEAD
85
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.1.1...HEAD
86
+ [2.1.1]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.1.0...2.1.1
75
87
  [2.1.0]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.0.0...2.1.0
76
88
  [2.0.0]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/1.2.1...2.0.0
77
89
  [1.2.1]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/1.2.0...1.2.1
data/README.md CHANGED
@@ -57,6 +57,28 @@
57
57
  /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'
58
58
  ```
59
59
 
60
+ ### Security
61
+
62
+ Rather than being lazy and giving it say the root user or another user that has root privileges you should create a new user with the minimum required permissions. See the table below for minimum permissions for each check.
63
+
64
+ | Check | Permissions |
65
+ |:---------------------------------------|:----------------------------------------------------------|
66
+ | check-mysql-alive.rb | `SELECT` |
67
+ | check-mysql-connections.rb | `SELECT` |
68
+ | check-mysql-disk.rb | `SELECT` |
69
+ | check-mysql-innodb-lock.rb | `PROCESS` |
70
+ | check-mysql-query-result-count.rb | depends on query |
71
+ | check-mysql-replication-status.rb | `SUPER` OR `REPLICATION_CLIENT` (the latter is preferable)|
72
+ | check-mysql-status.rb | `SELECT` |
73
+ | check-mysql-threads.rb | `SELECT` |
74
+ | metrics-mysql-graphite.rb | `SELECT` |
75
+ | metrics-mysql-processes.rb | `SELECT` |
76
+ | metrics-mysql-query-result-count.rb | depends on query |
77
+ | metrics-mysql-raw.rb | `SELECT` |
78
+ | metrics-mysql.rb | `INSERT` into `sensumetrics.sensu_historic_metrics` |
79
+
80
+ 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.
81
+
60
82
  ## Installation
61
83
 
62
84
  [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
@@ -38,18 +38,22 @@ class CheckMysqlDisk < Sensu::Plugin::Check::CLI
38
38
  option :size,
39
39
  short: '-s',
40
40
  long: '--size=VALUE',
41
- description: 'Database size'
41
+ description: 'Database size',
42
+ proc: proc(&:to_f),
43
+ required: true
42
44
 
43
45
  option :warn,
44
46
  short: '-w',
45
47
  long: '--warning=VALUE',
46
48
  description: 'Warning threshold',
49
+ proc: proc(&:to_f),
47
50
  default: '85'
48
51
 
49
52
  option :crit,
50
53
  short: '-c',
51
54
  long: '--critical=VALUE',
52
55
  description: 'Critical threshold',
56
+ proc: proc(&:to_f),
53
57
  default: '95'
54
58
 
55
59
  option :port,
@@ -76,9 +80,9 @@ class CheckMysqlDisk < Sensu::Plugin::Check::CLI
76
80
  db_pass = config[:pass]
77
81
  end
78
82
  db_host = config[:host]
79
- disk_size = config[:size].to_f
80
- critical_usage = config[:crit].to_f
81
- warning_usage = config[:warn].to_f
83
+ disk_size = config[:size]
84
+ critical_usage = config[:crit]
85
+ warning_usage = config[:warn]
82
86
 
83
87
  if [db_host, db_user, db_pass, disk_size].any?(&:nil?)
84
88
  unknown 'Must specify host, user, password and size'
@@ -2,7 +2,7 @@ module SensuPluginsMySql
2
2
  module Version
3
3
  MAJOR = 2
4
4
  MINOR = 1
5
- PATCH = 0
5
+ PATCH = 1
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-mysql
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-10 00:00:00.000000000 Z
11
+ date: 2017-06-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inifile