sensu-plugins-nrpe 0.0.2 → 0.2.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: 3e47916432d40967d18de41b63599144b938009e
4
- data.tar.gz: 2694ffff657bea897da2ddd51a16d3b6540b2a1e
3
+ metadata.gz: 6775913f166846ec21060da774fd921cd0a200c4
4
+ data.tar.gz: fd681172b7e4d5931dafd140062d078bdb8ebf53
5
5
  SHA512:
6
- metadata.gz: 3c99b8d6f177b466493d985bd05863678a3cd0301ba6fa5dc132ef363df16ee96095a3c7af33b4a8989b5b33204561b1e638ae9ce0ed32e31ed062dbfbf2effe
7
- data.tar.gz: bd2a1df7e32a63ae356be8a6b95831b0259e29c5c2cacd820af9b3673aff299e74ee9bae4107943c422918851208d0a6ee8085fee8ce71778a6776a97c4ba500
6
+ metadata.gz: 4c799d6ce98d29e0053155734026aee7d68f3514b5bea27823038c9b3ee6dace39a2b5e97f63e28a71f8e1de65c0dc6bbb8e2c6833cffb8a365edd0ef12a9175
7
+ data.tar.gz: 6b587aae909e4fb05e145bf60204fa1c0c87bf2b8298b2b28db16913ec73758943cc1fe54d8ba209a670c3a5f438436e22414104eb50678aa31f60ad24a98c94
@@ -1,12 +1,26 @@
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
7
 
8
- ## [0.0.2] - 2016-08-11
8
+ ## [0.2.1] - 2017-05-11
9
+ ### Added
10
+ - Add Ruby 2.4.1 to travis tests
11
+
12
+ ## [0.2.0] - 2017-05-10
13
+ ### Added
14
+ - renamed .travis.yml so it will work.
15
+ - appeased the rubocops
16
+ - fixing ci
9
17
 
18
+ ## [0.1.0] - 2017-05-10
19
+ ### Added
20
+ - Basic Skel
21
+ - missing PR template
22
+
23
+ ## [0.0.2] - 2016-08-11
10
24
  ### Fixed
11
25
  - simplify check-nrpe.rb output due to variances in different nagios plugin check results
12
26
 
@@ -18,3 +32,7 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
18
32
 
19
33
  ### Added
20
34
  - initial release
35
+
36
+ [Unreleased]: https://github.com/sensu-plugins/sensu-plugins-nrpe/compare/0.2.1...HEAD
37
+ [0.2.1]: https://github.com/sensu-plugins/sensu-plugins-nrpe/compare/0.2.0...0.2.1
38
+ [0.2.0]: https://github.com/sensu-plugins/sensu-plugins-nrpe/compare/0.1.0...0.2.0
data/LICENSE CHANGED
@@ -1,22 +1,22 @@
1
- Copyright (c) 2015 Sensu-Plugins
1
+ The MIT License (MIT)
2
2
 
3
- MIT License
3
+ Copyright (c) 2016 Sensu Community Plugins
4
4
 
5
- Permission is hereby granted, free of charge, to any person obtaining
6
- a copy of this software and associated documentation files (the
7
- "Software"), to deal in the Software without restriction, including
8
- without limitation the rights to use, copy, modify, merge, publish,
9
- distribute, sublicense, and/or sell copies of the Software, and to
10
- permit persons to whom the Software is furnished to do so, subject to
11
- the following conditions:
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
12
11
 
13
- The above copyright notice and this permission notice shall be
14
- included in all copies or substantial portions of the Software.
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
15
22
 
16
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
- NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
- LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
- OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
- WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md CHANGED
@@ -5,7 +5,6 @@
5
5
  [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-nrpe/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-nrpe)
6
6
  [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-nrpe/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-nrpe)
7
7
  [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-nrpe.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-nrpe)
8
- [![Codeship Status for sensu-plugins/sensu-plugins-nrpe](https://codeship.com/projects/c7145640-e8a4-0132-3bde-62885e5c211b/status?branch=master)](https://codeship.com/projects/82852)
9
8
 
10
9
  ## Functionality
11
10
 
@@ -1,9 +1,13 @@
1
1
  #!/usr/bin/env ruby
2
- # Check NRPE
3
- # ===
4
2
  #
5
- # This is a simple NRPE check script for Sensu, We need to supply details like
6
- # Server, port, NRPE plugin, and plugin arguments
3
+ # Check NRPE
4
+ #
5
+ # DESCRIPTION:
6
+ # This is a simple NRPE check script for Sensu, We need to supply details
7
+ # like Server, port, NRPE plugin, and plugin arguments
8
+ #
9
+ # OUTPUT:
10
+ # plain text
7
11
  #
8
12
  # DEPENDENCIES:
9
13
  # gem: sensu-plugin
@@ -30,14 +34,10 @@ require 'nrpeclient'
30
34
  class CheckNRPE < Sensu::Plugin::Check::CLI
31
35
  option :host,
32
36
  short: '-H host',
33
- boolean: true,
34
- default: '127.0.0.1',
35
- required: true
37
+ default: '127.0.0.1'
36
38
 
37
39
  option :check,
38
40
  short: '-c check_plugin',
39
- boolean: true,
40
- default: '',
41
41
  required: true
42
42
 
43
43
  option :args,
@@ -47,12 +47,14 @@ class CheckNRPE < Sensu::Plugin::Check::CLI
47
47
  option :port,
48
48
  short: '-P port',
49
49
  description: 'port to use (default:5666)',
50
- default: '5666'
50
+ default: 5666,
51
+ proc: proc(&:to_i)
51
52
 
52
- option :ssl,
53
- short: '-S use ssl',
54
- description: 'enable ssl (default:true)',
55
- default: true
53
+ option :disable_ssl,
54
+ short: '-d',
55
+ description: 'disable ssl (default:false)',
56
+ boolean: true,
57
+ default: false
56
58
 
57
59
  option :match,
58
60
  short: '-m match',
@@ -60,8 +62,8 @@ class CheckNRPE < Sensu::Plugin::Check::CLI
60
62
 
61
63
  def run
62
64
  begin
63
- request = Nrpeclient::CheckNrpe.new({:host=> "#{config[:host]}", :port=> "#{config[:port]}", :ssl=> config[:ssl]})
64
- response = request.send_command("#{config[:check]}", "#{config[:args]}")
65
+ request = Nrpeclient::CheckNrpe.new(host: config[:host].to_s, port: config[:port], ssl: !config[:disable_ssl])
66
+ response = request.send_command(config[:check].to_s, config[:args].to_s)
65
67
  rescue Errno::ETIMEDOUT
66
68
  unknown "#{config[:host]} not responding"
67
69
  rescue => e
@@ -79,9 +81,9 @@ class CheckNRPE < Sensu::Plugin::Check::CLI
79
81
  response_status = response_captures[0][0].downcase
80
82
  response_data = response_captures[0][1]
81
83
  case response_status
82
- when "critical"
84
+ when 'critical'
83
85
  critical response_data
84
- when "warning"
86
+ when 'warning'
85
87
  warning response_data
86
88
  else
87
89
  ok response_data
@@ -1,8 +1,12 @@
1
1
  #!/usr/bin/env ruby
2
- # NRPE Metrics
3
- # ===
4
2
  #
5
- # This is a simple script to collect metrics from an NRPE plugin
3
+ # NRPE Metrics
4
+ #
5
+ # DESCRIPTION:
6
+ # This is a simple script to collect metrics from an NRPE plugin
7
+ #
8
+ # OUTPUT:
9
+ # metric data
6
10
  #
7
11
  # DEPENDENCIES:
8
12
  # gem: sensu-plugin
@@ -28,13 +32,10 @@ require 'nrpeclient'
28
32
  class NRPEGraphite < Sensu::Plugin::Metric::CLI::Graphite
29
33
  option :host,
30
34
  short: '-H host',
31
- boolean: true,
32
- default: '127.0.0.1',
33
- required: true
35
+ default: '127.0.0.1'
34
36
 
35
37
  option :check,
36
38
  short: '-c check_plugin',
37
- boolean: true,
38
39
  default: '',
39
40
  required: true
40
41
 
@@ -54,12 +55,14 @@ class NRPEGraphite < Sensu::Plugin::Metric::CLI::Graphite
54
55
  option :port,
55
56
  short: '-P port',
56
57
  description: 'port to use (default:5666)',
57
- default: '5666'
58
+ default: 5666,
59
+ proc: proc(&:to_i)
58
60
 
59
- option :ssl,
60
- short: '-S use ssl',
61
- description: 'enable ssl (default:true)',
62
- default: true
61
+ option :disable_ssl,
62
+ short: '-d',
63
+ description: 'disable ssl (default:false)',
64
+ boolean: true,
65
+ default: false
63
66
 
64
67
  option :graphite,
65
68
  short: '-g',
@@ -68,14 +71,14 @@ class NRPEGraphite < Sensu::Plugin::Metric::CLI::Graphite
68
71
 
69
72
  def run
70
73
  begin
71
- request = Nrpeclient::CheckNrpe.new({:host=> "#{config[:host]}", :port=> "#{config[:port]}", :ssl=> config[:ssl]})
72
- response = request.send_command("#{config[:check]}", "#{config[:args]}")
74
+ request = Nrpeclient::CheckNrpe.new(host: config[:host].to_s, port: config[:port], ssl: !config[:disable_ssl])
75
+ response = request.send_command(config[:check].to_s, config[:args].to_s)
73
76
  rescue Errno::ETIMEDOUT
74
77
  unknown "#{config[:host]} not responding"
75
78
  rescue => e
76
79
  unknown "An unknown error occured: #{e.inspect}"
77
80
  end
78
- config[:host] = config[:host].gsub('.', '_') if config[:graphite]
81
+ config[:host] = config[:host].tr('.', '_') if config[:graphite]
79
82
  perfdata = response.buffer.split('|')[1].scan(/([^=]+=\S+)/)
80
83
  perfdata.each do |pd|
81
84
  metric = /^([^=]+)=([\d\.\-\+eE]+)([\w\/%]*);?([\d\.\-\+eE:~@]+)?;?([\d\.\-\+eE:~@]+)?;?([\d\.\-\+eE]+)?;?([\d\.\-\+eE]+)?;?\s*/.match(pd[0]) # rubocop:disable LineLength
@@ -1,8 +1,8 @@
1
1
  module SensuPluginsNrpe
2
2
  module Version
3
3
  MAJOR = 0
4
- MINOR = 0
5
- PATCH = 2
4
+ MINOR = 2
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-nrpe
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.2.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: 2016-08-11 00:00:00.000000000 Z
11
+ date: 2017-05-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sensu-plugin
@@ -39,131 +39,131 @@ dependencies:
39
39
  - !ruby/object:Gem::Version
40
40
  version: 0.1.3
41
41
  - !ruby/object:Gem::Dependency
42
- name: codeclimate-test-reporter
42
+ name: bundler
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '0.4'
47
+ version: '1.7'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '0.4'
54
+ version: '1.7'
55
55
  - !ruby/object:Gem::Dependency
56
- name: rubocop
56
+ name: codeclimate-test-reporter
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 0.40.0
61
+ version: '0.4'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 0.40.0
68
+ version: '0.4'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rspec
70
+ name: github-markup
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '3.1'
75
+ version: '1.3'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '3.1'
82
+ version: '1.3'
83
83
  - !ruby/object:Gem::Dependency
84
- name: bundler
84
+ name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '1.7'
89
+ version: '0.10'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.7'
96
+ version: '0.10'
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '10.0'
103
+ version: '10.5'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - "~>"
109
109
  - !ruby/object:Gem::Version
110
- version: '10.0'
110
+ version: '10.5'
111
111
  - !ruby/object:Gem::Dependency
112
- name: github-markup
112
+ name: redcarpet
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
115
  - - "~>"
116
116
  - !ruby/object:Gem::Version
117
- version: '1.3'
117
+ version: '3.2'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - "~>"
123
123
  - !ruby/object:Gem::Version
124
- version: '1.3'
124
+ version: '3.2'
125
125
  - !ruby/object:Gem::Dependency
126
- name: redcarpet
126
+ name: rubocop
127
127
  requirement: !ruby/object:Gem::Requirement
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: '3.2'
131
+ version: 0.40.0
132
132
  type: :development
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: '3.2'
138
+ version: 0.40.0
139
139
  - !ruby/object:Gem::Dependency
140
- name: yard
140
+ name: rspec
141
141
  requirement: !ruby/object:Gem::Requirement
142
142
  requirements:
143
143
  - - "~>"
144
144
  - !ruby/object:Gem::Version
145
- version: '0.8'
145
+ version: '3.4'
146
146
  type: :development
147
147
  prerelease: false
148
148
  version_requirements: !ruby/object:Gem::Requirement
149
149
  requirements:
150
150
  - - "~>"
151
151
  - !ruby/object:Gem::Version
152
- version: '0.8'
152
+ version: '3.4'
153
153
  - !ruby/object:Gem::Dependency
154
- name: pry
154
+ name: yard
155
155
  requirement: !ruby/object:Gem::Requirement
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: '0.10'
159
+ version: '0.8'
160
160
  type: :development
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: '0.10'
166
+ version: '0.8'
167
167
  description: |-
168
168
  This plugin provides native NRPE instrumentation
169
169
  for monitoring and metrics collection, based on
@@ -200,7 +200,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - ">="
202
202
  - !ruby/object:Gem::Version
203
- version: 1.9.3
203
+ version: 2.0.0
204
204
  required_rubygems_version: !ruby/object:Gem::Requirement
205
205
  requirements:
206
206
  - - ">="
@@ -208,7 +208,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
208
208
  version: '0'
209
209
  requirements: []
210
210
  rubyforge_project:
211
- rubygems_version: 2.2.2
211
+ rubygems_version: 2.4.5
212
212
  signing_key:
213
213
  specification_version: 4
214
214
  summary: Sensu plugins for NRPE