sensu-plugins-percona 1.0.0 → 1.1.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
2
  SHA1:
3
- metadata.gz: 5d955aab2683a68a994f13affa6805d0916d6c94
4
- data.tar.gz: 23e6fc5c6c366dbd7dcce683dd44632b3bfef247
3
+ metadata.gz: f2ed90f76ee8c82e43f8870ad9d93fa689c2f945
4
+ data.tar.gz: 8d74e115b96ccfbfba4dfa257a904059c01cb4c5
5
5
  SHA512:
6
- metadata.gz: a8bc8d6f506c96d7ffdf93ea09efecf9fe5333f3c4868093c9a258ff94077016ad0ce09be299eb9a75088dcdcb90d42adc39311cd2427559b69125bfd5191957
7
- data.tar.gz: 4d10962e58fd33f02f45241dc989419e35c80a5985efdca70b2eaff4d0766cb98b6fad70c4305a0c80c997ebc6bee7e8337ad93344f60e63d66235672416670b
6
+ metadata.gz: 1823a0b4d78c45f438dd689a9fac870595dd988d98bc6b946c151bd9be51a800507d40ffbb1201568309725080bb5601c368f1132a6851dfd8a30c29ab0b7932
7
+ data.tar.gz: 898c7771c2631439e1e635d43ada482a4e408fbd1e8a57bc1b2769d52bd8f82cb1989ed444ca424c62cb41b6146409a536cf0e9e18cd26d5abb98adf88fbfcd4
@@ -1,9 +1,20 @@
1
- #Change Log
1
+ # Change Log
2
2
  This project adheres to [Semantic Versioning](http://semver.org/).
3
3
 
4
4
  This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
5
5
 
6
6
  ## [Unreleased]
7
+ ### [1.1.0] - 2017-08-09
8
+ ### Removed
9
+ - removed `mysql` gem dep as we have `mysql2` and `mysql` does not work on ruby 2.4 and has been abandoned. (@majormoses)
10
+
11
+ ### Changed
12
+ - check-percona-cluster-size.rb: converted to use `mysql2` gem (@majormoses)
13
+ - check-wsrep-ready.rb: converted to use `mysql2` gem (@majormoses)
14
+
15
+ ### Added
16
+ - ruby 2.4 testing to travis (@majormoses)
17
+ - slack badge (@majormoses)
7
18
 
8
19
  ## [1.0.0] - 2016-09-25
9
20
  ### Added
@@ -25,6 +36,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
25
36
  - initial release
26
37
  - added ability to use ini files
27
38
 
28
- [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-percona/compare/1.0.0...HEAD
39
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-percona/compare/1.1.0...HEAD
40
+ [1.1.0]: https://github.com/sensu-plugins/sensu-plugins-percona/compare/1.0.0...1.1.0
29
41
  [1.0.0]: https://github.com/sensu-plugins/sensu-plugins-percona/compare/0.0.2...1.0.0
30
42
  [0.0.2]: https://github.com/sensu-plugins/sensu-plugins-percona/compare/0.0.1...0.0.2
data/README.md CHANGED
@@ -5,6 +5,7 @@
5
5
  [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-percona/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-percona)
6
6
  [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-percona/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-percona)
7
7
  [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-percona.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-percona)
8
+ [![Slack Status](https://sensucommunityslack.herokuapp.com/badge.svg)](https://sensucommunityslack.herokuapp.com)
8
9
 
9
10
  ## Functionality
10
11
 
@@ -9,13 +9,13 @@
9
9
  # Based on the MySQL Health Plugin by Panagiotis Papadomitsos
10
10
  #
11
11
  # Depends on mysql:
12
- # gem install mysql
12
+ # gem install mysql2
13
13
  #
14
14
  # Released under the same terms as Sensu (the MIT license); see LICENSE
15
15
  # for details.
16
16
 
17
17
  require 'sensu-plugin/check/cli'
18
- require 'mysql'
18
+ require 'mysql2'
19
19
  require 'inifile'
20
20
 
21
21
  class CheckPerconaClusterSize < Sensu::Plugin::Check::CLI
@@ -51,15 +51,16 @@ class CheckPerconaClusterSize < Sensu::Plugin::Check::CLI
51
51
  if config[:ini]
52
52
  update_config
53
53
  end
54
- db = Mysql.real_connect(config[:hostname], config[:user], config[:password], config[:database])
55
- cluster_size = db
56
- .query("SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size'")
57
- .fetch_hash
58
- .fetch('Value')
59
- .to_i
54
+ db = Mysql2::Client.new(
55
+ host: config[:hostname],
56
+ username: config[:user],
57
+ password: config[:password],
58
+ database: config[:database]
59
+ )
60
+ cluster_size = db.query("SHOW GLOBAL STATUS LIKE 'wsrep_cluster_size'").first['Value'].to_i
60
61
  critical "Expected to find #{config[:expected]} nodes, found #{cluster_size}" if cluster_size != config[:expected].to_i
61
62
  ok "Expected to find #{config[:expected]} nodes and found those #{cluster_size}" if cluster_size == config[:expected].to_i
62
- rescue Mysql::Error => e
63
+ rescue Mysql2::Error => e
63
64
  critical "Percona MySQL check failed: #{e.error}"
64
65
  ensure
65
66
  db.close if db
@@ -13,7 +13,7 @@
13
13
  #
14
14
  # DEPENDENCIES:
15
15
  # gem: sensu-plugin
16
- # gem: mysql
16
+ # gem: mysql2
17
17
  #
18
18
  # USAGE:
19
19
  #
@@ -28,7 +28,7 @@
28
28
  #
29
29
 
30
30
  require 'sensu-plugin/check/cli'
31
- require 'mysql'
31
+ require 'mysql2'
32
32
 
33
33
  class CheckWsrepReady < Sensu::Plugin::Check::CLI
34
34
  option :user,
@@ -49,11 +49,16 @@ class CheckWsrepReady < Sensu::Plugin::Check::CLI
49
49
  default: 'localhost'
50
50
 
51
51
  def run
52
- db = Mysql.real_connect(config[:hostname], config[:user], config[:password], config[:database])
53
- wsrep_ready = db.query("SHOW STATUS LIKE 'wsrep_ready';").fetch_hash.fetch('Value')
52
+ db = Mysql2::Client.new(
53
+ host: config[:hostname],
54
+ username: config[:user],
55
+ password: config[:password],
56
+ database: config[:database]
57
+ )
58
+ wsrep_ready = db.query("SHOW STATUS LIKE 'wsrep_ready';").first['Value']
54
59
  critical "WSREP Ready is not ON. Is #{wsrep_ready}" if wsrep_ready != 'ON'
55
60
  ok 'Cluster is OK!' if wsrep_ready == 'ON'
56
- rescue Mysql::Error => e
61
+ rescue Mysql2::Error => e
57
62
  critical "Percona MySQL check failed: #{e.error}"
58
63
  ensure
59
64
  db.close if db
@@ -1,7 +1,7 @@
1
1
  module SensuPluginsPercona
2
2
  module Version
3
3
  MAJOR = 1
4
- MINOR = 0
4
+ MINOR = 1
5
5
  PATCH = 0
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-percona
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.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: 2016-09-26 00:00:00.000000000 Z
11
+ date: 2017-08-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -24,34 +24,20 @@ dependencies:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: '1.2'
27
- - !ruby/object:Gem::Dependency
28
- name: mysql
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '='
32
- - !ruby/object:Gem::Version
33
- version: 2.9.1
34
- type: :runtime
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '='
39
- - !ruby/object:Gem::Version
40
- version: 2.9.1
41
27
  - !ruby/object:Gem::Dependency
42
28
  name: mysql2
43
29
  requirement: !ruby/object:Gem::Requirement
44
30
  requirements:
45
31
  - - '='
46
32
  - !ruby/object:Gem::Version
47
- version: 0.3.18
33
+ version: 0.4.8
48
34
  type: :runtime
49
35
  prerelease: false
50
36
  version_requirements: !ruby/object:Gem::Requirement
51
37
  requirements:
52
38
  - - '='
53
39
  - !ruby/object:Gem::Version
54
- version: 0.3.18
40
+ version: 0.4.8
55
41
  - !ruby/object:Gem::Dependency
56
42
  name: inifile
57
43
  requirement: !ruby/object:Gem::Requirement
@@ -235,7 +221,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
235
221
  version: '0'
236
222
  requirements: []
237
223
  rubyforge_project:
238
- rubygems_version: 2.5.1
224
+ rubygems_version: 2.4.5
239
225
  signing_key:
240
226
  specification_version: 4
241
227
  summary: Sensu plugins for percona