sensu-plugins-mofa 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 32b8161cd2520bf548d29afcad007f8d0e962232
4
- data.tar.gz: e92d85271258b5d574e879f5727bd93a3c12ea38
3
+ metadata.gz: dbc4bbcc2b960ad6fb91e5ddcda86864d19e1e67
4
+ data.tar.gz: 99d37c6be54d74b5cc91ad4210a3f18a394258e3
5
5
  SHA512:
6
- metadata.gz: 0a2cca04d19ff09a3025fbc5d55898baee02c5721fe654e5e9ff5e335786eff1291ee124fb4cf27f955c9a1227fceed73690594eeead75e92cfb56006a197ab4
7
- data.tar.gz: beb99cdc493301df10bead48559d4708f6c1b6b308bf97c313412a97e82e197e04b7725b69cdbf00b43f427ff93e117c1d43f9104e89faaec7004e29ee386039
6
+ metadata.gz: c73d7c483c7e2adc2f08c718eb79d046f6d1cb65e35e85e580e4547aa8498b7d179efde4507c6dd53a0d04672812504acd81404d705502954b5af9988f245c75
7
+ data.tar.gz: a765067297300d1e828abba3095dce49bd5718e4628c244e188915a092a5916b4b58d57552ca37be6dce0c48b425a7ad54368adce7b0c7a089709fdc92877c83
@@ -28,35 +28,36 @@
28
28
 
29
29
  require 'sensu-plugin/check/cli'
30
30
 
31
- class ContainerLogChecker < Sensu::Plugin::Check::CLI
31
+ class MofaProvisioningChecker < Sensu::Plugin::Check::CLI
32
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'
33
+ description: 'Mofa Status dir - defaults to /var/lib/mofa',
34
+ short: '-s /var/lib/mofa',
35
+ long: '--mofa-status-file /var/lib/mofa',
36
+ default: '/var/lib/mofa'
37
37
 
38
- def process_mofa_status_file(mofa_status_file)
39
- result = 'UNKNOWN'
40
- if File.file?(mofa_status_file)
38
+ def process_mofa_status_dir(mofa_status_dir)
39
+ data = { result: 'UNKNOWN' }
40
+ if File.file?(mofa_status_dir)
41
41
  status = File.read(mofa_status_file).chomp
42
42
  case
43
43
  when status =~ /SUCCESS/
44
- result = 'SUCCESS'
44
+ data.result = 'SUCCESS'
45
45
  when status =~ /FAIL/
46
- result = 'FAIL'
46
+ data.result = 'FAIL'
47
47
  end
48
48
  end
49
- result
49
+ data
50
50
  end
51
51
 
52
52
  def run
53
- case process_mofa_status_file(config[:mofa_status_file])
53
+ data = process_mofa_status_file(config[:mofa_status_dir])
54
+ case data.result
54
55
  when 'UNKNOWN'
55
- unknown 'Cannot detect any mofa provisining (yet?).'
56
+ unknown 'Cannot detect any mofa provisining (no cookbook info found).'
56
57
  when 'SUCCESS'
57
- ok 'Last mofa provisioning was successful.'
58
+ ok 'Last mofa provisioning was successful ()'
58
59
  when 'FAIL'
59
- critical 'Last mofa provisioning failed!'
60
+ critical 'Last mofa provisioning failed! ()'
60
61
  end
61
62
  end
62
63
  end
@@ -2,7 +2,7 @@ module SensuPluginsMofa
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- PATCH = 1
5
+ PATCH = 2
6
6
 
7
7
  VER_STRING = [MAJOR, MINOR, PATCH].compact.join('.')
8
8
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sensu-plugins-mofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sensu-Plugins and contributors