sensu-plugins-php-fpm 0.0.5 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/CHANGELOG.md +12 -4
- data/README.md +16 -4
- data/bin/check-php-fpm.rb +16 -13
- data/bin/metrics-php-fpm.rb +1 -1
- data/lib/sensu-plugins-php-fpm/version.rb +2 -2
- metadata +33 -55
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NzYxZDVjZTQwYjJjMWIzOTgzOTE1Y2RlMGQ1Zjk0ZGFkMjIzYzcwNA==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
Yzc0ZTFhOGNlNzFhMDFhNTVlMWQ4YTc4M2Q1NGIwMWJhNjA4NzNkYw==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZmY0NjIzMzE5MDJiMGU3OTg0MDVlYjU2ZGZlM2RjOWVlNTBjMzMwMWRlYTQx
|
10
|
+
OGZiNjJjOTg2MTViYjRkZDEyYmUwZDA5YzZmMjI2NWUzYjVjNTUzNGQwOTUz
|
11
|
+
M2UzODkzZjU3MTQ3NmYwNjNmNmVmYTY1OTk2M2ZhOGU2M2QyNTI=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
OTFiODFmZGZlMTY3OTc3MjQ3OGZkMmNlOWExNGUyOTk2NTZmMzhjYzk3MDE5
|
14
|
+
Zjc1NDc3ZGZjMTBlMjBhYmUyZTZmMTQ0MjQzYTg3NTQzZTU0YzAzYWI4Y2Jk
|
15
|
+
MzQ1ZDE5NTZhYTgzYzljMmM3NzAzYjE3ZDRjYTQyOTdkNDFjMGQ=
|
data/CHANGELOG.md
CHANGED
@@ -3,7 +3,15 @@ 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
|
-
## Unreleased
|
6
|
+
## [Unreleased]
|
7
|
+
|
8
|
+
## [0.1.0] - 2016-09-25
|
9
|
+
### Added
|
10
|
+
- check-php-fpm.rb: added --pool option for mapping pools based on args in Nginx
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
- Changed dependency on sensu-plugin from strict (= 1.2.0) to pessimistic (~> 1.2)
|
14
|
+
- Updated Nginx configuration examples in README
|
7
15
|
|
8
16
|
## [0.0.5] - 2016-01-06
|
9
17
|
### Fixed
|
@@ -18,7 +26,6 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
18
26
|
- updated sensu-plugin gem to 1.2.0
|
19
27
|
|
20
28
|
## [0.0.2] - 2015-06-03
|
21
|
-
|
22
29
|
### Fixed
|
23
30
|
- added binstubs
|
24
31
|
|
@@ -26,11 +33,12 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
26
33
|
- removed cruft from /lib
|
27
34
|
|
28
35
|
## 0.0.1 - 2015-05-21
|
29
|
-
|
30
36
|
### Added
|
31
37
|
- initial release
|
32
38
|
|
33
|
-
[
|
39
|
+
[Unreleased]: https://github.com/sensu-plugins/sensu-plugins-php-fpm/compare/0.1.0...HEAD
|
40
|
+
[0.1.0]: https://github.com/sensu-plugins/sensu-plugins-php-fpm/compare/0.0.5...0.1.0
|
41
|
+
[0.0.5]: https://github.com/sensu-plugins/sensu-plugins-php-fpm/compare/0.0.4...0.0.5
|
34
42
|
[0.0.4]: https://github.com/sensu-plugins/sensu-plugins-php-fpm/compare/0.0.3...0.0.4
|
35
43
|
[0.0.3]: https://github.com/sensu-plugins/sensu-plugins-php-fpm/compare/0.0.2...0.0.3
|
36
44
|
[0.0.2]: https://github.com/sensu-plugins/sensu-plugins-php-fpm/compare/0.0.1...0.0.2
|
data/README.md
CHANGED
@@ -5,7 +5,6 @@
|
|
5
5
|
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-php-fpm/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-php-fpm)
|
6
6
|
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-php-fpm/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-php-fpm)
|
7
7
|
[![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-php-fpm.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-php-fpm)
|
8
|
-
[![Codeship Status for sensu-plugins/sensu-plugins-php-fpm](https://codeship.com/projects/427ed6d0-dc04-0132-8e5a-1e3fe125131b/status?branch=master)](https://codeship.com/projects/79856)
|
9
8
|
|
10
9
|
## Functionality
|
11
10
|
|
@@ -15,16 +14,29 @@
|
|
15
14
|
|
16
15
|
## Usage
|
17
16
|
|
18
|
-
|
17
|
+
Make sure you adjust the `fastcgi_pass` socket to whatever you are using:
|
19
18
|
|
20
19
|
```
|
21
|
-
|
20
|
+
location ~ "/fpm-(status|ping)" {
|
21
|
+
include /etc/nginx/fastcgi_params;
|
22
|
+
fastcgi_pass unix:/var/run/php5-fpm.sock;
|
23
|
+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
24
|
+
access_log off;
|
25
|
+
allow 127.0.0.1;
|
26
|
+
deny all;
|
27
|
+
}
|
28
|
+
```
|
29
|
+
|
30
|
+
Alternatively, but keep in mind that "ifs are evil":
|
31
|
+
|
32
|
+
```
|
33
|
+
set $pool "php5-fpm";
|
22
34
|
if ($arg_pool) {
|
23
35
|
set $pool $arg_pool;
|
24
36
|
}
|
25
37
|
location ~ "/fpm-(status|ping)" {
|
26
38
|
include /etc/nginx/fastcgi_params;
|
27
|
-
fastcgi_pass unix:/var/run
|
39
|
+
fastcgi_pass unix:/var/run/$pool.sock;
|
28
40
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
29
41
|
access_log off;
|
30
42
|
allow 127.0.0.1;
|
data/bin/check-php-fpm.rb
CHANGED
@@ -33,12 +33,6 @@ require 'uri'
|
|
33
33
|
require 'socket'
|
34
34
|
|
35
35
|
class CheckPHPFpm < Sensu::Plugin::Check::CLI
|
36
|
-
option :pool,
|
37
|
-
short: '-p POOL',
|
38
|
-
long: '--pool POOL',
|
39
|
-
description: 'Full POOL name to fpm ping page, example: https://yoursite.com/fpm-ping?pool=POOL',
|
40
|
-
default: 'www-data'
|
41
|
-
|
42
36
|
option :hostname,
|
43
37
|
short: '-h HOSTNAME',
|
44
38
|
long: '--host HOSTNAME',
|
@@ -46,25 +40,30 @@ class CheckPHPFpm < Sensu::Plugin::Check::CLI
|
|
46
40
|
default: 'localhost'
|
47
41
|
|
48
42
|
option :port,
|
49
|
-
short: '-
|
43
|
+
short: '-p PORT',
|
50
44
|
long: '--port PORT',
|
51
45
|
description: 'Nginx port',
|
52
46
|
default: '80'
|
53
47
|
|
54
48
|
option :path,
|
55
49
|
short: '-q PATH',
|
56
|
-
long: '--
|
50
|
+
long: '--path PATH',
|
57
51
|
description: 'Path to your fpm ping',
|
58
|
-
default: 'fpm-ping
|
52
|
+
default: 'fpm-ping'
|
53
|
+
|
54
|
+
option :pool,
|
55
|
+
short: '-P ?pool=POOL',
|
56
|
+
long: '--pool ?pool=POOL',
|
57
|
+
description: 'Name of your pool, if you are dynamically mapping pools based on args in Nginx'
|
59
58
|
|
60
59
|
option :scheme,
|
61
|
-
description: '
|
60
|
+
description: 'Request scheme to use',
|
62
61
|
short: '-s SCHEME',
|
63
62
|
long: '--scheme SCHEME',
|
64
63
|
default: 'http://'
|
65
64
|
|
66
65
|
option :response,
|
67
|
-
description: '
|
66
|
+
description: 'Expected response',
|
68
67
|
short: '-r RESPONSE',
|
69
68
|
long: '--response RESPONSE',
|
70
69
|
default: 'pong'
|
@@ -84,7 +83,11 @@ class CheckPHPFpm < Sensu::Plugin::Check::CLI
|
|
84
83
|
default: false
|
85
84
|
|
86
85
|
def run
|
87
|
-
|
86
|
+
if config[:pool]
|
87
|
+
config[:path] = config[:path] + config[:pool]
|
88
|
+
end
|
89
|
+
|
90
|
+
config[:url] = config[:scheme] + config[:hostname].to_s + ':' + config[:port].to_s + '/' + config[:path].to_s
|
88
91
|
config[:fqdn] = Socket.gethostname
|
89
92
|
uri = URI.parse(config[:url])
|
90
93
|
|
@@ -100,7 +103,7 @@ class CheckPHPFpm < Sensu::Plugin::Check::CLI
|
|
100
103
|
|
101
104
|
if response.code == '200'
|
102
105
|
if response.body == config[:response]
|
103
|
-
ok
|
106
|
+
ok config[:response].to_s
|
104
107
|
else
|
105
108
|
critical "#{response.body} instead of #{config[:response]}"
|
106
109
|
end
|
data/bin/metrics-php-fpm.rb
CHANGED
@@ -46,7 +46,7 @@ class PhpfpmMetrics < Sensu::Plugin::Metric::CLI::Graphite
|
|
46
46
|
http.use_ssl = true
|
47
47
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
48
48
|
end
|
49
|
-
request = Net::HTTP::Get.new(uri.request_uri + '?xml', 'User-Agent' =>
|
49
|
+
request = Net::HTTP::Get.new(uri.request_uri + '?xml', 'User-Agent' => config[:agent].to_s)
|
50
50
|
response = http.request(request)
|
51
51
|
if response.code == '200'
|
52
52
|
found = true
|
metadata
CHANGED
@@ -1,36 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-php-fpm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sensu-Plugins and contributors
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
|
-
cert_chain:
|
11
|
-
-
|
12
|
-
-----BEGIN CERTIFICATE-----
|
13
|
-
MIIDgDCCAmigAwIBAgIBATANBgkqhkiG9w0BAQUFADBDMRIwEAYDVQQDDAltYXR0
|
14
|
-
am9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AuGXNaWItiPPMseSQzLJ
|
29
|
-
JKP4hVvbc1d+oS925B1lcBiqn2aYvElbyNAVmQPywNNqkWmvtlqj9ZVJfV5HQLdu
|
30
|
-
8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
|
31
|
-
HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
|
32
|
-
-----END CERTIFICATE-----
|
33
|
-
date: 2016-01-06 00:00:00.000000000 Z
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-09-26 00:00:00.000000000 Z
|
34
12
|
dependencies:
|
35
13
|
- !ruby/object:Gem::Dependency
|
36
14
|
name: crack
|
@@ -50,147 +28,147 @@ dependencies:
|
|
50
28
|
name: sensu-plugin
|
51
29
|
requirement: !ruby/object:Gem::Requirement
|
52
30
|
requirements:
|
53
|
-
- -
|
31
|
+
- - ~>
|
54
32
|
- !ruby/object:Gem::Version
|
55
|
-
version: 1.2
|
33
|
+
version: '1.2'
|
56
34
|
type: :runtime
|
57
35
|
prerelease: false
|
58
36
|
version_requirements: !ruby/object:Gem::Requirement
|
59
37
|
requirements:
|
60
|
-
- -
|
38
|
+
- - ~>
|
61
39
|
- !ruby/object:Gem::Version
|
62
|
-
version: 1.2
|
40
|
+
version: '1.2'
|
63
41
|
- !ruby/object:Gem::Dependency
|
64
42
|
name: bundler
|
65
43
|
requirement: !ruby/object:Gem::Requirement
|
66
44
|
requirements:
|
67
|
-
- -
|
45
|
+
- - ~>
|
68
46
|
- !ruby/object:Gem::Version
|
69
47
|
version: '1.7'
|
70
48
|
type: :development
|
71
49
|
prerelease: false
|
72
50
|
version_requirements: !ruby/object:Gem::Requirement
|
73
51
|
requirements:
|
74
|
-
- -
|
52
|
+
- - ~>
|
75
53
|
- !ruby/object:Gem::Version
|
76
54
|
version: '1.7'
|
77
55
|
- !ruby/object:Gem::Dependency
|
78
56
|
name: codeclimate-test-reporter
|
79
57
|
requirement: !ruby/object:Gem::Requirement
|
80
58
|
requirements:
|
81
|
-
- -
|
59
|
+
- - ~>
|
82
60
|
- !ruby/object:Gem::Version
|
83
61
|
version: '0.4'
|
84
62
|
type: :development
|
85
63
|
prerelease: false
|
86
64
|
version_requirements: !ruby/object:Gem::Requirement
|
87
65
|
requirements:
|
88
|
-
- -
|
66
|
+
- - ~>
|
89
67
|
- !ruby/object:Gem::Version
|
90
68
|
version: '0.4'
|
91
69
|
- !ruby/object:Gem::Dependency
|
92
70
|
name: github-markup
|
93
71
|
requirement: !ruby/object:Gem::Requirement
|
94
72
|
requirements:
|
95
|
-
- -
|
73
|
+
- - ~>
|
96
74
|
- !ruby/object:Gem::Version
|
97
75
|
version: '1.3'
|
98
76
|
type: :development
|
99
77
|
prerelease: false
|
100
78
|
version_requirements: !ruby/object:Gem::Requirement
|
101
79
|
requirements:
|
102
|
-
- -
|
80
|
+
- - ~>
|
103
81
|
- !ruby/object:Gem::Version
|
104
82
|
version: '1.3'
|
105
83
|
- !ruby/object:Gem::Dependency
|
106
84
|
name: pry
|
107
85
|
requirement: !ruby/object:Gem::Requirement
|
108
86
|
requirements:
|
109
|
-
- -
|
87
|
+
- - ~>
|
110
88
|
- !ruby/object:Gem::Version
|
111
89
|
version: '0.10'
|
112
90
|
type: :development
|
113
91
|
prerelease: false
|
114
92
|
version_requirements: !ruby/object:Gem::Requirement
|
115
93
|
requirements:
|
116
|
-
- -
|
94
|
+
- - ~>
|
117
95
|
- !ruby/object:Gem::Version
|
118
96
|
version: '0.10'
|
119
97
|
- !ruby/object:Gem::Dependency
|
120
98
|
name: rake
|
121
99
|
requirement: !ruby/object:Gem::Requirement
|
122
100
|
requirements:
|
123
|
-
- -
|
101
|
+
- - ~>
|
124
102
|
- !ruby/object:Gem::Version
|
125
103
|
version: '10.0'
|
126
104
|
type: :development
|
127
105
|
prerelease: false
|
128
106
|
version_requirements: !ruby/object:Gem::Requirement
|
129
107
|
requirements:
|
130
|
-
- -
|
108
|
+
- - ~>
|
131
109
|
- !ruby/object:Gem::Version
|
132
110
|
version: '10.0'
|
133
111
|
- !ruby/object:Gem::Dependency
|
134
112
|
name: redcarpet
|
135
113
|
requirement: !ruby/object:Gem::Requirement
|
136
114
|
requirements:
|
137
|
-
- -
|
115
|
+
- - ~>
|
138
116
|
- !ruby/object:Gem::Version
|
139
117
|
version: '3.2'
|
140
118
|
type: :development
|
141
119
|
prerelease: false
|
142
120
|
version_requirements: !ruby/object:Gem::Requirement
|
143
121
|
requirements:
|
144
|
-
- -
|
122
|
+
- - ~>
|
145
123
|
- !ruby/object:Gem::Version
|
146
124
|
version: '3.2'
|
147
125
|
- !ruby/object:Gem::Dependency
|
148
126
|
name: rubocop
|
149
127
|
requirement: !ruby/object:Gem::Requirement
|
150
128
|
requirements:
|
151
|
-
- -
|
129
|
+
- - ~>
|
152
130
|
- !ruby/object:Gem::Version
|
153
|
-
version: 0.
|
131
|
+
version: 0.40.0
|
154
132
|
type: :development
|
155
133
|
prerelease: false
|
156
134
|
version_requirements: !ruby/object:Gem::Requirement
|
157
135
|
requirements:
|
158
|
-
- -
|
136
|
+
- - ~>
|
159
137
|
- !ruby/object:Gem::Version
|
160
|
-
version: 0.
|
138
|
+
version: 0.40.0
|
161
139
|
- !ruby/object:Gem::Dependency
|
162
140
|
name: rspec
|
163
141
|
requirement: !ruby/object:Gem::Requirement
|
164
142
|
requirements:
|
165
|
-
- -
|
143
|
+
- - ~>
|
166
144
|
- !ruby/object:Gem::Version
|
167
145
|
version: '3.1'
|
168
146
|
type: :development
|
169
147
|
prerelease: false
|
170
148
|
version_requirements: !ruby/object:Gem::Requirement
|
171
149
|
requirements:
|
172
|
-
- -
|
150
|
+
- - ~>
|
173
151
|
- !ruby/object:Gem::Version
|
174
152
|
version: '3.1'
|
175
153
|
- !ruby/object:Gem::Dependency
|
176
154
|
name: yard
|
177
155
|
requirement: !ruby/object:Gem::Requirement
|
178
156
|
requirements:
|
179
|
-
- -
|
157
|
+
- - ~>
|
180
158
|
- !ruby/object:Gem::Version
|
181
159
|
version: '0.8'
|
182
160
|
type: :development
|
183
161
|
prerelease: false
|
184
162
|
version_requirements: !ruby/object:Gem::Requirement
|
185
163
|
requirements:
|
186
|
-
- -
|
164
|
+
- - ~>
|
187
165
|
- !ruby/object:Gem::Version
|
188
166
|
version: '0.8'
|
189
167
|
description: Sensu plugins for php-fpm
|
190
|
-
email:
|
168
|
+
email: <sensu-users@googlegroups.com>
|
191
169
|
executables:
|
192
|
-
- metrics-php-fpm.rb
|
193
170
|
- check-php-fpm.rb
|
171
|
+
- metrics-php-fpm.rb
|
194
172
|
extensions: []
|
195
173
|
extra_rdoc_files: []
|
196
174
|
files:
|
@@ -205,7 +183,7 @@ homepage: https://github.com/sensu-plugins/sensu-plugins-php-fpm
|
|
205
183
|
licenses:
|
206
184
|
- MIT
|
207
185
|
metadata:
|
208
|
-
maintainer:
|
186
|
+
maintainer: ! '@tas50'
|
209
187
|
development_status: active
|
210
188
|
production_status: unstable - testing recommended
|
211
189
|
release_draft: 'false'
|
@@ -217,17 +195,17 @@ require_paths:
|
|
217
195
|
- lib
|
218
196
|
required_ruby_version: !ruby/object:Gem::Requirement
|
219
197
|
requirements:
|
220
|
-
- -
|
198
|
+
- - ! '>='
|
221
199
|
- !ruby/object:Gem::Version
|
222
200
|
version: 1.9.3
|
223
201
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
224
202
|
requirements:
|
225
|
-
- -
|
203
|
+
- - ! '>='
|
226
204
|
- !ruby/object:Gem::Version
|
227
205
|
version: '0'
|
228
206
|
requirements: []
|
229
207
|
rubyforge_project:
|
230
|
-
rubygems_version: 2.4.
|
208
|
+
rubygems_version: 2.4.5
|
231
209
|
signing_key:
|
232
210
|
specification_version: 4
|
233
211
|
summary: Sensu plugins for php-fpm
|
checksums.yaml.gz.sig
DELETED
Binary file
|
data.tar.gz.sig
DELETED
Binary file
|
metadata.gz.sig
DELETED
Binary file
|