sensu-plugins-mofa 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 32b8161cd2520bf548d29afcad007f8d0e962232
4
+ data.tar.gz: e92d85271258b5d574e879f5727bd93a3c12ea38
5
+ SHA512:
6
+ metadata.gz: 0a2cca04d19ff09a3025fbc5d55898baee02c5721fe654e5e9ff5e335786eff1291ee124fb4cf27f955c9a1227fceed73690594eeead75e92cfb56006a197ab4
7
+ data.tar.gz: beb99cdc493301df10bead48559d4708f6c1b6b308bf97c313412a97e82e197e04b7725b69cdbf00b43f427ff93e117c1d43f9104e89faaec7004e29ee386039
data/CHANGELOG.md ADDED
@@ -0,0 +1,4 @@
1
+ #Change Log
2
+ This project adheres to [Semantic Versioning](http://semver.org/).
3
+
4
+ This CHANGELOG follows the format listed at [Keep A Changelog](http://keepachangelog.com/)
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2017 Sensu-Plugins
2
+
3
+ MIT License
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:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
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 ADDED
@@ -0,0 +1,21 @@
1
+ ## Sensu-Plugins-mofa
2
+
3
+ [![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-mofa.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-mofa)
4
+ [![Gem Version](https://badge.fury.io/rb/sensu-plugins-mofa.svg)](http://badge.fury.io/rb/sensu-plugins-mofa)
5
+ [![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-mofa/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-mofa)
6
+ [![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-mofa/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-mofa)
7
+ [![Dependency Status](https://gemnasium.com/sensu-plugins/sensu-plugins-mofa.svg)](https://gemnasium.com/sensu-plugins/sensu-plugins-mofa)
8
+
9
+ ## Functionality
10
+
11
+ ## Files
12
+ * check-mofa-provisioning.rb
13
+
14
+ ## Usage
15
+
16
+ ## Installation
17
+
18
+ [Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)
19
+
20
+ ## Notes
21
+ [mofa-engine API](https://docs.mofa.com/engine/api/v1.29/#section/Versioning)
@@ -0,0 +1,62 @@
1
+ #! /usr/bin/env ruby
2
+ #
3
+ # check-mofo-provisioning
4
+ #
5
+ # DESCRIPTION:
6
+ # Checks mofa logs and status
7
+ #
8
+ # OUTPUT:
9
+ # plain text
10
+ #
11
+ # PLATFORMS:
12
+ # Linux
13
+ #
14
+ # DEPENDENCIES:
15
+ # gem: sensu-plugin
16
+ #
17
+ # USAGE:
18
+ # check-container-logs.rb -H /tmp/docker.sock -n logspout -r 'problem sending' -r 'i/o timeout' -i 'Remark:' -i 'The configuration is'
19
+ # => 1 container running = OK
20
+ # => 4 container running = CRITICAL
21
+ #
22
+ # NOTES:
23
+ # The API parameter required to use the limited lookback (-t) was introduced
24
+ # the Docker server API version 1.19. This check may still work on older API
25
+ # versions if you don't want to limit the timestamps of logs.
26
+ #
27
+ #
28
+
29
+ require 'sensu-plugin/check/cli'
30
+
31
+ class ContainerLogChecker < Sensu::Plugin::Check::CLI
32
+ option :mofa_status_file,
33
+ description: 'Mofa Status file - defaults to /var/lib/mofa/last_status',
34
+ short: '-s /var/lib/mofa/last_status',
35
+ long: '--mofa-status-file /var/lib/mofa/last_status',
36
+ default: '/var/lib/mofa/last_status'
37
+
38
+ def process_mofa_status_file(mofa_status_file)
39
+ result = 'UNKNOWN'
40
+ if File.file?(mofa_status_file)
41
+ status = File.read(mofa_status_file).chomp
42
+ case
43
+ when status =~ /SUCCESS/
44
+ result = 'SUCCESS'
45
+ when status =~ /FAIL/
46
+ result = 'FAIL'
47
+ end
48
+ end
49
+ result
50
+ end
51
+
52
+ def run
53
+ case process_mofa_status_file(config[:mofa_status_file])
54
+ when 'UNKNOWN'
55
+ unknown 'Cannot detect any mofa provisining (yet?).'
56
+ when 'SUCCESS'
57
+ ok 'Last mofa provisioning was successful.'
58
+ when 'FAIL'
59
+ critical 'Last mofa provisioning failed!'
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,9 @@
1
+ module SensuPluginsMofa
2
+ module Version
3
+ MAJOR = 0
4
+ MINOR = 0
5
+ PATCH = 1
6
+
7
+ VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
+ end
9
+ end
@@ -0,0 +1 @@
1
+ require 'sensu-plugins-mofa/version'
metadata ADDED
@@ -0,0 +1,198 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: sensu-plugins-mofa
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Sensu-Plugins and contributors
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-08-01 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: sensu-plugin
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '1.2'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1.2'
27
+ - !ruby/object:Gem::Dependency
28
+ name: bundler
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.7'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.7'
41
+ - !ruby/object:Gem::Dependency
42
+ name: codeclimate-test-reporter
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.4'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.4'
55
+ - !ruby/object:Gem::Dependency
56
+ name: github-markup
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1.3'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: pry
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '0.10'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '0.10'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rake
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '10.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '10.0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: redcarpet
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - "~>"
102
+ - !ruby/object:Gem::Version
103
+ version: '3.2'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '3.2'
111
+ - !ruby/object:Gem::Dependency
112
+ name: rspec
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - "~>"
116
+ - !ruby/object:Gem::Version
117
+ version: '3.1'
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '3.1'
125
+ - !ruby/object:Gem::Dependency
126
+ name: rubocop
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: 0.40.0
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: 0.40.0
139
+ - !ruby/object:Gem::Dependency
140
+ name: yard
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.8'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.8'
153
+ description: |-
154
+ This plugin provides Mofa instrumentation
155
+ for monitoring and metrics collection
156
+ email: "<sensu-users@googlegroups.com>"
157
+ executables:
158
+ - check-mofa-provisioning.rb
159
+ extensions: []
160
+ extra_rdoc_files: []
161
+ files:
162
+ - CHANGELOG.md
163
+ - LICENSE
164
+ - README.md
165
+ - bin/check-mofa-provisioning.rb
166
+ - lib/sensu-plugins-mofa.rb
167
+ - lib/sensu-plugins-mofa/version.rb
168
+ homepage: https://gitlab.fos.allcop.local/infra/sensu-plugins-mofa
169
+ licenses:
170
+ - MIT
171
+ metadata:
172
+ maintainer: birk_a
173
+ development_status: active
174
+ production_status: unstable - testing recommended
175
+ release_draft: 'false'
176
+ release_prerelease: 'false'
177
+ post_install_message: You can use the embedded Ruby by setting EMBEDDED_RUBY=true
178
+ in /etc/default/sensu
179
+ rdoc_options: []
180
+ require_paths:
181
+ - lib
182
+ required_ruby_version: !ruby/object:Gem::Requirement
183
+ requirements:
184
+ - - ">="
185
+ - !ruby/object:Gem::Version
186
+ version: 2.0.0
187
+ required_rubygems_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ requirements: []
193
+ rubyforge_project:
194
+ rubygems_version: 2.6.3
195
+ signing_key:
196
+ specification_version: 4
197
+ summary: Sensu plugins for mofa
198
+ test_files: []