sensu-plugins-serverspec 0.0.2 → 0.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 +4 -4
- checksums.yaml.gz.sig +0 -0
- data/CHANGELOG.md +9 -2
- data/README.md +1 -2
- data/bin/check-serverspec.rb +29 -3
- data/lib/sensu-plugins-serverspec/version.rb +2 -2
- data.tar.gz.sig +2 -1
- metadata +5 -5
- metadata.gz.sig +1 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: faae26ebc4548927e8b9fc70d79528fa1110b1bc
|
4
|
+
data.tar.gz: b2044b92c3872f8f2cba6b0ef61f96deeb3649e7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 005db3a5c671b2cc13c2f65f815ce744790b284db33cc41f8fc3b172f279397b8769ce21282f7ef4b5c16ce0b317335c6996ca0b31b35ebe3784dd7930e02f0b
|
7
|
+
data.tar.gz: 4443b53a6d6ae6c4a265e070fd0b8e645efd61e5d8cb078f16ad0755c2c1be791ad2c62370bf8b6631231f491ba43805d4e853a76d94bd32731e70b6086a812c
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
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] - 2015-11-10
|
9
|
+
### Added
|
10
|
+
- Support for Windows
|
11
|
+
|
12
|
+
### Changed
|
13
|
+
- Use fully qualified path of invoking Ruby (to handle cases when Ruby is not on the system path)
|
14
|
+
- Updated serverspec gem to 2.24.2
|
7
15
|
|
8
16
|
## [0.0.2] - 2015-07-14
|
9
17
|
### Changed
|
@@ -16,4 +24,3 @@ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachang
|
|
16
24
|
|
17
25
|
### Added
|
18
26
|
- initial release
|
19
|
-
|
data/README.md
CHANGED
@@ -14,9 +14,8 @@
|
|
14
14
|
|
15
15
|
## Usage
|
16
16
|
|
17
|
-
|
18
17
|
## Installation
|
19
18
|
|
20
|
-
[Installation and Setup](
|
19
|
+
[Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
|
21
20
|
|
22
21
|
## Notes
|
data/bin/check-serverspec.rb
CHANGED
@@ -14,8 +14,6 @@
|
|
14
14
|
#
|
15
15
|
# DEPENDENCIES:
|
16
16
|
# gem: sensu-plugin
|
17
|
-
# gem: json
|
18
|
-
# gem: socket
|
19
17
|
# gem: serverspec
|
20
18
|
#
|
21
19
|
# USAGE:
|
@@ -63,6 +61,25 @@ class CheckServerspec < Sensu::Plugin::Check::CLI
|
|
63
61
|
u.send(msg + "\n", 0, '127.0.0.1', 3030)
|
64
62
|
end
|
65
63
|
|
64
|
+
# http://stackoverflow.com/questions/11784109/detecting-operating-systems-in-ruby
|
65
|
+
def os
|
66
|
+
@os ||= (
|
67
|
+
host_os = RbConfig::CONFIG['host_os']
|
68
|
+
case host_os
|
69
|
+
when /mswin|msys|mingw|cygwin|bccwin|wince|emc/
|
70
|
+
:windows
|
71
|
+
when /darwin|mac os/
|
72
|
+
:macosx
|
73
|
+
when /linux/
|
74
|
+
:linux
|
75
|
+
when /solaris|bsd/
|
76
|
+
:unix
|
77
|
+
else
|
78
|
+
fail NotImplementedError, "unknown os: #{host_os.inspect}"
|
79
|
+
end
|
80
|
+
)
|
81
|
+
end
|
82
|
+
|
66
83
|
def send_ok(check_name, msg)
|
67
84
|
d = { 'name' => check_name, 'status' => 0, 'output' => 'OK: ' + msg, 'handler' => config[:handler] }
|
68
85
|
sensu_client_socket d.to_json
|
@@ -79,7 +96,16 @@ class CheckServerspec < Sensu::Plugin::Check::CLI
|
|
79
96
|
end
|
80
97
|
|
81
98
|
def run
|
82
|
-
|
99
|
+
operating_system = os
|
100
|
+
# require fully qualified path as embedded ruby may not be on the system path
|
101
|
+
ruby_exec = File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')
|
102
|
+
# requires for '-S' option to search for scripts
|
103
|
+
ENV['RUBYPATH'] = RbConfig::CONFIG['bindir']
|
104
|
+
if operating_system == (:linux || :macosx || :unix)
|
105
|
+
serverspec_results = `cd #{config[:tests_dir]} ; #{ruby_exec} -S rspec #{config[:spec_tests]} --format json`
|
106
|
+
elsif operating_system == :windows
|
107
|
+
serverspec_results = `cd #{config[:tests_dir]} & #{ruby_exec} -S rspec #{config[:spec_tests]} --format json`
|
108
|
+
end
|
83
109
|
parsed = JSON.parse(serverspec_results)
|
84
110
|
|
85
111
|
parsed['examples'].each do |serverspec_test|
|
data.tar.gz.sig
CHANGED
@@ -1 +1,2 @@
|
|
1
|
-
��
|
1
|
+
��l1����{A�ǣ
|
2
|
+
�\�HY�����K�{a��!���nk�Kzidp8��p�H<��c��u��u�MJ��t�c X�)8'��x�,c�t��U��vY$x��+���R*p�h(�v�ް��L.s�*������rn���KV]f�5n�EQ'�n�u��C͏�ߗ�g�K+���������=�Μ�V�|��|�3&� �f2�?����V�����!N�<p>09�b���I���kg��`@�/�.��7�o
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sensu-plugins-serverspec
|
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
|
@@ -30,7 +30,7 @@ cert_chain:
|
|
30
30
|
8sHuVruarogxxKPBzlL2is4EUb6oN/RdpGx2l4254+nyR+abg//Ed27Ym0PkB4lk
|
31
31
|
HP0m8WSjZmFr109pE/sVsM5jtOCvogyujQOjNVGN4gz1wwPr
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date: 2015-
|
33
|
+
date: 2015-11-12 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: sensu-plugin
|
@@ -52,14 +52,14 @@ dependencies:
|
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 2.
|
55
|
+
version: 2.24.2
|
56
56
|
type: :runtime
|
57
57
|
prerelease: false
|
58
58
|
version_requirements: !ruby/object:Gem::Requirement
|
59
59
|
requirements:
|
60
60
|
- - '='
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 2.
|
62
|
+
version: 2.24.2
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
name: bundler
|
65
65
|
requirement: !ruby/object:Gem::Requirement
|
@@ -225,7 +225,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
225
225
|
version: '0'
|
226
226
|
requirements: []
|
227
227
|
rubyforge_project:
|
228
|
-
rubygems_version: 2.4.
|
228
|
+
rubygems_version: 2.4.8
|
229
229
|
signing_key:
|
230
230
|
specification_version: 4
|
231
231
|
summary: Sensu plugins for serverspec
|
metadata.gz.sig
CHANGED
@@ -1,2 +1 @@
|
|
1
|
-
|
2
|
-
=��ĦP���XR����>�c�_sk�Y��ۙ�hܢb'�G�����ϼS����p��[U��Zh�Ls�P�r�Yj����o8�]�,΅101wRAI��K�aL孝��^.̴ř�������6'�ŗ��~u��!)�
|
1
|
+
��m��r�Di�a(�0r��¹� �+�Ӭ�{�Z�=��d�F��� ).�u�M�I�$S��-W�C.�ȼ!X�,J����V�]B�W=� �(Nž��aE�}ڕ�R�~�7��rG�·��p:*/z��(������9T�0�����WY�q��IF��q�)5�ܨ��� %E�,���vF2�5}v6����K䖫_9�K<�r��m,�jC�*|�<��t�:����?��*>�7���AI�:�_
|