sensu-plugins-mysql 2.1.2 → 2.2.0

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
- SHA1:
3
- metadata.gz: 7a3f47930f8ac4e6169ecd568784a515973f794e
4
- data.tar.gz: b5a697219c0ed255ccc8f91534b464bf7a2b606c
2
+ SHA256:
3
+ metadata.gz: 00f0faaf8dfab6860c08be60b8afa307d1a3cd0d3d726064ec3a595ab9291317
4
+ data.tar.gz: 69e069e01e98de450846d64e6d4bb324ea227c89ccdd23d4877d21a916d9742d
5
5
  SHA512:
6
- metadata.gz: a19f0dcac1046df6e83661fd8bdc209f61393afa30552d0c919252500d289f7167ec894a1cbab37bed91d81bba1fdd8f1aff7a1d87a5f175ec13c9e21883457e
7
- data.tar.gz: e361955c2b457d4fdd0eefd7cc0db2245a16ec6b9e4ecf388260228c2f7f84fe73e7209b31445da3a64202e12518c52eaad1f88b1f92db8f2c055d3831d2df39
6
+ metadata.gz: de0a27cf35313a4a2e330d175bbf8695524e1a13a7ecdf68bcd76ec0003e6c16375f4c0d7c76a11fd25a52f60a716125acf5137767ace63a2ca94d3208013b5b
7
+ data.tar.gz: c2627626aa929925a9697b1ef1d13da422806460e526149590f6256fbb0a19e160c0afa9acc8115911281f9e995450c4bda7c7425f6da777a1d85d3143c268cf
@@ -1,10 +1,30 @@
1
1
  # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
- This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
4
+ This CHANGELOG follows the format listed [here](https://github.com/sensu-plugins/community/blob/master/HOW_WE_CHANGELOG.md)
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [2.2.0] - 2017-11-19
9
+ ### Changed
10
+ - check-mysql-alive.rb: Add support for custom section in inifile. (@oba11)
11
+ - check-mysql-connections.rb: Add support for custom section in inifile. (@oba11)
12
+ - check-mysql-disk.rb: Add support for custom section in inifile. (@oba11)
13
+ - check-mysql-innodb-lock.rb: Add support for custom section in inifile. (@oba11)
14
+ - check-mysql-query-result-count.rb: Add support for custom section in inifile. (@oba11)
15
+ - check-mysql-replication-status.rb: Add support for custom section in inifile. (@oba11)
16
+ - check-mysql-status.rb: Add support for custom section in inifile. (@oba11)
17
+ - check-mysql-threads.rb: Add support for custom section in inifile. (@oba11)
18
+ - metrics-mysql-graphite.rb: Add support for custom section in inifile. (@oba11)
19
+ - metrics-mysql-processes.rb: Add support for custom section in inifile. (@oba11)
20
+ - metrics-mysql-query-result-count.rb: Add support for custom section in inifile. (@oba11)
21
+ - metrics-mysql-raw.rb: Add support for custom section in inifile. (@oba11)
22
+ - README.md: update useage to have an example using the custom ini section (@majormoses)
23
+ - update changelog guidelines location (@majormoses)
24
+
25
+ ### Fixed
26
+ - misc spelling and whitespace (@majormoses)
27
+
8
28
  ## [2.1.2] - 2017-10-04
9
29
  ### Changed
10
30
  - In `README` clarify why they should not use privileged users for monitoring with sensu. (@majormoses)
@@ -90,7 +110,8 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
90
110
  ### Added
91
111
  - initial release
92
112
 
93
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.1.1...HEAD
113
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.2.0...HEAD
114
+ [2.2.0]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.1.1...2.2.0
94
115
  [2.1.2]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.1.1...2.1.2
95
116
  [2.1.1]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.1.0...2.1.1
96
117
  [2.1.0]: https://github.com/sensu-plugins/sensu-plugins-mysql/compare/2.0.0...2.1.0
data/README.md CHANGED
@@ -53,7 +53,7 @@ $ /opt/sensu/embedded/bin/check-mysql-connections.rb --host=<DBHOST> --ini=/etc/
53
53
 
54
54
  **check-mysql-alive** example
55
55
  ```bash
56
- $ /opt/sensu/embedded/bin/check-mysql-alive.rb --host=<DBHOST> --ini=/etc/sensu/my.ini
56
+ $ /opt/sensu/embedded/bin/check-mysql-alive.rb --host=<DBHOST> --ini=/etc/sensu/my.ini --ini-section=customsection
57
57
  ```
58
58
 
59
59
  **check-mysql-disk** example (note: you must supply max disk size)
@@ -19,12 +19,17 @@
19
19
  #
20
20
  # EXAMPLE
21
21
  # mysql-alive.rb -h db01 --ini '/etc/sensu/my.cnf'
22
+ # mysql-alive.rb -h db01 --ini '/etc/sensu/my.cnf' --ini-section customsection
22
23
  #
23
24
  # MY.CNF INI FORMAT
24
25
  # [client]
25
26
  # user=sensu
26
27
  # password="abcd1234"
27
28
  #
29
+ # [customsection]
30
+ # user=user
31
+ # password="password"
32
+ #
28
33
 
29
34
  require 'sensu-plugin/check/cli'
30
35
  require 'mysql'
@@ -46,6 +51,11 @@ class CheckMySQL < Sensu::Plugin::Check::CLI
46
51
  short: '-i',
47
52
  long: '--ini VALUE'
48
53
 
54
+ option :ini_section,
55
+ description: 'Section in my.cnf ini file',
56
+ long: '--ini-section VALUE',
57
+ default: 'client'
58
+
49
59
  option :hostname,
50
60
  description: 'Hostname to login to',
51
61
  short: '-h HOST',
@@ -71,7 +81,7 @@ class CheckMySQL < Sensu::Plugin::Check::CLI
71
81
  def run
72
82
  if config[:ini]
73
83
  ini = IniFile.load(config[:ini])
74
- section = ini['client']
84
+ section = ini[config[:ini_section]]
75
85
  db_user = section['user']
76
86
  db_pass = section['password']
77
87
  else
@@ -31,6 +31,11 @@ class CheckMySQLHealth < Sensu::Plugin::Check::CLI
31
31
  short: '-i',
32
32
  long: '--ini VALUE'
33
33
 
34
+ option :ini_section,
35
+ description: 'Section in my.cnf ini file',
36
+ long: '--ini-section VALUE',
37
+ default: 'client'
38
+
34
39
  option :hostname,
35
40
  description: 'Hostname to login to',
36
41
  short: '-h HOST',
@@ -69,7 +74,7 @@ class CheckMySQLHealth < Sensu::Plugin::Check::CLI
69
74
  def run
70
75
  if config[:ini]
71
76
  ini = IniFile.load(config[:ini])
72
- section = ini['client']
77
+ section = ini[config[:ini_section]]
73
78
  db_user = section['user']
74
79
  db_pass = section['password']
75
80
  else
@@ -35,6 +35,11 @@ class CheckMysqlDisk < Sensu::Plugin::Check::CLI
35
35
  short: '-i',
36
36
  long: '--ini VALUE'
37
37
 
38
+ option :ini_section,
39
+ description: 'Section in my.cnf ini file',
40
+ long: '--ini-section VALUE',
41
+ default: 'client'
42
+
38
43
  option :size,
39
44
  short: '-s',
40
45
  long: '--size=VALUE',
@@ -72,7 +77,7 @@ class CheckMysqlDisk < Sensu::Plugin::Check::CLI
72
77
  def run
73
78
  if config[:ini]
74
79
  ini = IniFile.load(config[:ini])
75
- section = ini['client']
80
+ section = ini[config[:ini_section]]
76
81
  db_user = section['user']
77
82
  db_pass = section['password']
78
83
  else
@@ -31,6 +31,11 @@ class CheckMySQLInnoDBLock < Sensu::Plugin::Check::CLI
31
31
  short: '-i',
32
32
  long: '--ini VALUE'
33
33
 
34
+ option :ini_section,
35
+ description: 'Section in my.cnf ini file',
36
+ long: '--ini-section VALUE',
37
+ default: 'client'
38
+
34
39
  option :hostname,
35
40
  description: 'Hostname to login to',
36
41
  short: '-h HOST',
@@ -63,7 +68,7 @@ class CheckMySQLInnoDBLock < Sensu::Plugin::Check::CLI
63
68
  def run
64
69
  if config[:ini]
65
70
  ini = IniFile.load(config[:ini])
66
- section = ini['client']
71
+ section = ini[config[:ini_section]]
67
72
  db_user = section['user']
68
73
  db_pass = section['password']
69
74
  else
@@ -49,6 +49,11 @@ class MysqlQueryCountCheck < Sensu::Plugin::Check::CLI
49
49
  long: '--ini VALUE',
50
50
  description: 'My.cnf ini file'
51
51
 
52
+ option :ini_section,
53
+ description: 'Section in my.cnf ini file',
54
+ long: '--ini-section VALUE',
55
+ default: 'client'
56
+
52
57
  option :socket,
53
58
  short: '-S SOCKET',
54
59
  long: '--socket SOCKET',
@@ -77,7 +82,7 @@ class MysqlQueryCountCheck < Sensu::Plugin::Check::CLI
77
82
  def run
78
83
  if config[:ini]
79
84
  ini = IniFile.load(config[:ini])
80
- section = ini['client']
85
+ section = ini[config[:ini_section]]
81
86
  db_user = section['user']
82
87
  db_pass = section['password']
83
88
  else
@@ -17,12 +17,17 @@
17
17
  #
18
18
  # EXAMPLE
19
19
  # mysql-alive.rb -h db01 --ini '/etc/sensu/my.cnf'
20
+ # mysql-alive.rb -h db01 --ini '/etc/sensu/my.cnf' --ini-section customsection
20
21
  #
21
22
  # MY.CNF INI FORMAT
22
23
  # [client]
23
24
  # user=sensu
24
25
  # password="abcd1234"
25
26
  #
27
+ # [customsection]
28
+ # user=user
29
+ # password="password"
30
+ #
26
31
 
27
32
  require 'sensu-plugin/check/cli'
28
33
  require 'mysql'
@@ -67,6 +72,11 @@ class CheckMysqlReplicationStatus < Sensu::Plugin::Check::CLI
67
72
  long: '--ini VALUE',
68
73
  description: 'My.cnf ini file'
69
74
 
75
+ option :ini_section,
76
+ description: 'Section in my.cnf ini file',
77
+ long: '--ini-section VALUE',
78
+ default: 'client'
79
+
70
80
  option :warn,
71
81
  short: '-w',
72
82
  long: '--warning=VALUE',
@@ -86,7 +96,7 @@ class CheckMysqlReplicationStatus < Sensu::Plugin::Check::CLI
86
96
  def run
87
97
  if config[:ini]
88
98
  ini = IniFile.load(config[:ini])
89
- section = ini['client']
99
+ section = ini[config[:ini_section]]
90
100
  db_user = section['user']
91
101
  db_pass = section['password']
92
102
  else
@@ -51,6 +51,11 @@ class CheckMySQLStatus < Sensu::Plugin::Check::CLI
51
51
  short: '-i',
52
52
  long: '--ini VALUE'
53
53
 
54
+ option :ini_section,
55
+ description: 'Section in my.cnf ini file',
56
+ long: '--ini-section VALUE',
57
+ default: 'client'
58
+
54
59
  option :hostname,
55
60
  description: 'Hostname to login to',
56
61
  short: '-h HOST',
@@ -107,7 +112,7 @@ class CheckMySQLStatus < Sensu::Plugin::Check::CLI
107
112
  def credentials
108
113
  if config[:ini]
109
114
  ini = IniFile.load(config[:ini])
110
- section = ini['client']
115
+ section = ini[config[:ini_section]]
111
116
  db_user = section['user']
112
117
  db_pass = section['password']
113
118
  db_socket = section['socket']
@@ -51,6 +51,11 @@ class CheckMySQLHealth < Sensu::Plugin::Check::CLI
51
51
  short: '-i',
52
52
  long: '--ini VALUE'
53
53
 
54
+ option :ini_section,
55
+ description: 'Section in my.cnf ini file',
56
+ long: '--ini-section VALUE',
57
+ default: 'client'
58
+
54
59
  option :hostname,
55
60
  description: 'Hostname to login to',
56
61
  short: '-h HOST',
@@ -95,7 +100,7 @@ class CheckMySQLHealth < Sensu::Plugin::Check::CLI
95
100
  def run
96
101
  if config[:ini]
97
102
  ini = IniFile.load(config[:ini])
98
- section = ini['client']
103
+ section = ini[config[:ini_section]]
99
104
  db_user = section['user']
100
105
  db_pass = section['password']
101
106
  else
@@ -23,12 +23,17 @@
23
23
  #
24
24
  # EXAMPLE
25
25
  # mysql-alive.rb -h db01 --ini '/etc/sensu/my.cnf'
26
+ # mysql-alive.rb -h db01 --ini '/etc/sensu/my.cnf' --ini-section customsection
26
27
  #
27
28
  # MY.CNF INI FORMAT
28
29
  # [client]
29
30
  # user=sensu
30
31
  # password="abcd1234"
31
32
  #
33
+ # [customsection]
34
+ # user=user
35
+ # password="password"
36
+ #
32
37
 
33
38
  require 'sensu-plugin/metric/cli'
34
39
  require 'mysql'
@@ -65,6 +70,11 @@ class MysqlGraphite < Sensu::Plugin::Metric::CLI::Graphite
65
70
  long: '--ini VALUE',
66
71
  description: 'My.cnf ini file'
67
72
 
73
+ option :ini_section,
74
+ description: 'Section in my.cnf ini file',
75
+ long: '--ini-section VALUE',
76
+ default: 'client'
77
+
68
78
  option :scheme,
69
79
  description: 'Metric naming scheme, text to prepend to metric',
70
80
  short: '-s SCHEME',
@@ -197,7 +207,7 @@ class MysqlGraphite < Sensu::Plugin::Metric::CLI::Graphite
197
207
  mysql_shorthostname = mysql_host.split('.')[0]
198
208
  if config[:ini]
199
209
  ini = IniFile.load(config[:ini])
200
- section = ini['client']
210
+ section = ini[config[:ini_section]]
201
211
  db_user = section['user']
202
212
  db_pass = section['password']
203
213
  else
@@ -25,12 +25,17 @@
25
25
  #
26
26
  # EXAMPLE
27
27
  # mysql-alive.rb -h db01 --ini '/etc/sensu/my.cnf'
28
+ # mysql-alive.rb -h db01 --ini '/etc/sensu/my.cnf' --ini-section customsection
28
29
  #
29
30
  # MY.CNF INI FORMAT
30
31
  # [client]
31
32
  # user=sensu
32
33
  # password="abcd1234"
33
34
  #
35
+ # [customsection]
36
+ # user=user
37
+ # password="password"
38
+ #
34
39
  # NOTES:
35
40
  #
36
41
  # LICENSE:
@@ -73,6 +78,11 @@ class MetricsMySQLProcesses < Sensu::Plugin::Metric::CLI::Graphite
73
78
  long: '--ini VALUE',
74
79
  description: 'My.cnf ini file'
75
80
 
81
+ option :ini_section,
82
+ description: 'Section in my.cnf ini file',
83
+ long: '--ini-section VALUE',
84
+ default: 'client'
85
+
76
86
  option :scheme,
77
87
  description: 'Metric naming scheme, text to prepend to metric',
78
88
  short: '-s SCHEME',
@@ -89,7 +99,7 @@ class MetricsMySQLProcesses < Sensu::Plugin::Metric::CLI::Graphite
89
99
  mysql_shorthostname = mysql_host.split('.')[0]
90
100
  if config[:ini]
91
101
  ini = IniFile.load(config[:ini])
92
- section = ini['client']
102
+ section = ini[config[:ini_section]]
93
103
  db_user = section['user']
94
104
  db_pass = section['password']
95
105
  else
@@ -49,6 +49,11 @@ class MysqlQueryCountMetric < Sensu::Plugin::Metric::CLI::Graphite
49
49
  long: '--ini VALUE',
50
50
  description: 'My.cnf ini file'
51
51
 
52
+ option :ini_section,
53
+ description: 'Section in my.cnf ini file',
54
+ long: '--ini-section VALUE',
55
+ default: 'client'
56
+
52
57
  option :socket,
53
58
  short: '-S SOCKET',
54
59
  long: '--socket SOCKET',
@@ -69,7 +74,7 @@ class MysqlQueryCountMetric < Sensu::Plugin::Metric::CLI::Graphite
69
74
  def run
70
75
  if config[:ini]
71
76
  ini = IniFile.load(config[:ini])
72
- section = ini['client']
77
+ section = ini[config[:ini_section]]
73
78
  db_user = section['user']
74
79
  db_pass = section['password']
75
80
  else
@@ -16,6 +16,7 @@
16
16
  #
17
17
  # EXAMPLE
18
18
  # metrics-mysql-raw.rb -h localhost --ini '/etc/sensu/my.cnf'
19
+ # metrics-mysql-raw.rb -h localhost --ini '/etc/sensu/my.cnf' --ini-section customsection
19
20
  #
20
21
  # MY.CNF INI FORMAT
21
22
  # [client]
@@ -23,6 +24,10 @@
23
24
  # password="abcd1234"
24
25
  # socket="/var/lib/mysql/mysql.sock"
25
26
  #
27
+ # [customsection]
28
+ # user=user
29
+ # password="password"
30
+ #
26
31
  # LICENSE:
27
32
  # Copyright 2012 Pete Shima <me@peteshima.com>
28
33
  # Additional hacks by Joe Miller - https://github.com/joemiller
@@ -57,6 +62,7 @@ class MetricsMySQLRaw < Sensu::Plugin::Metric::CLI::Graphite
57
62
  long: '--password PASS',
58
63
  default: 'mysqlPassWord'
59
64
  )
65
+
60
66
  option(
61
67
  :ini,
62
68
  description: 'My.cnf ini file',
@@ -64,6 +70,13 @@ class MetricsMySQLRaw < Sensu::Plugin::Metric::CLI::Graphite
64
70
  long: '--ini VALUE'
65
71
  )
66
72
 
73
+ option(
74
+ :ini_section,
75
+ description: 'Section in my.cnf ini file',
76
+ long: '--ini-section VALUE',
77
+ default: 'client'
78
+ )
79
+
67
80
  option(
68
81
  :hostname,
69
82
  description: 'Hostname to login to',
@@ -260,7 +273,7 @@ class MetricsMySQLRaw < Sensu::Plugin::Metric::CLI::Graphite
260
273
  def credentials
261
274
  if config[:ini]
262
275
  ini = IniFile.load(config[:ini])
263
- section = ini['client']
276
+ section = ini[config[:ini_section]]
264
277
  db_user = section['user']
265
278
  db_pass = section['password']
266
279
  db_socket = section['socket']
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsMySql
2
2
  module Version
3
3
  MAJOR = 2
4
- MINOR = 1
5
- PATCH = 2
4
+ MINOR = 2
5
+ PATCH = 0
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.2
4
+ version: 2.2.0
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-10-04 00:00:00.000000000 Z
11
+ date: 2017-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inifile
@@ -247,7 +247,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  version: '0'
248
248
  requirements: []
249
249
  rubyforge_project:
250
- rubygems_version: 2.6.13
250
+ rubygems_version: 2.7.2
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: Sensu plugins for MySql