sensu-plugins-mysql 2.1.0 → 2.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -1
- data/README.md +22 -0
- data/bin/check-mysql-disk.rb +8 -4
- data/lib/sensu-plugins-mysql/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b486ab1f37f22a717a6f7cbe8a571a82538ba90
|
4
|
+
data.tar.gz: f39d9d67e8575e3137b037603404e7a72cb27fda
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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)
|
data/bin/check-mysql-disk.rb
CHANGED
@@ -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]
|
80
|
-
critical_usage = config[:crit]
|
81
|
-
warning_usage = config[:warn]
|
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'
|
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.
|
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-
|
11
|
+
date: 2017-06-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: inifile
|