nagios-promoo 0.0.4 → 0.0.5

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: 2f7f2c421b78082e85f93d8b87f0a462098d0529
4
- data.tar.gz: 7e9a8dfbdbae3725060df61d23a102d16371b799
3
+ metadata.gz: 586b15304cbf0325aa52571802a4eecb4c2375f7
4
+ data.tar.gz: ed96a9964cfd2d7ffba0e293437d14965a7d88a6
5
5
  SHA512:
6
- metadata.gz: cd841214286f739bf7f3acfab1c45507d0b59897e6f13889640be748a80dc3df8657b7b08e36d38fd38158c76f53145dad2baa0535e5ce4eb82139027ad446fa
7
- data.tar.gz: f355d7bd0cbeae0643d7133b31f19843b2ebd12585896593906a125d56e5d5ce6eeb762812a24bf1f194c9a7f3b25145d2e3ddbc0acb52c8e0aae07fbf048da0
6
+ metadata.gz: 08cbefb1c033f2f00a30efcb71b8de286616b25ccca8dbd4be05caec6a136450adebb7fd8cee7cf8a98c5d5fce258d9745b7487aecbaa3fb11cdec25b2f09014
7
+ data.tar.gz: e4eec066e5cde62dcfe199772217965f8b800139583103a0f77a3b532b7cf7b2bb522cec32674045ebf4f141ee3ae2f6bdd209e60312cf9e8f2991a715e86a31
@@ -0,0 +1,48 @@
1
+ # Internal deps
2
+ require File.join(File.dirname(__FILE__), 'base_probe')
3
+ require File.join(File.dirname(__FILE__), 'kinds_probe')
4
+ require File.join(File.dirname(__FILE__), 'mixins_probe')
5
+
6
+ class Nagios::Promoo::Occi::Probes::CategoriesProbe < Nagios::Promoo::Occi::Probes::BaseProbe
7
+ class << self
8
+ def description
9
+ ['categories', 'Run a probe checking for mandatory OCCI categories definitions']
10
+ end
11
+
12
+ def options
13
+ [
14
+ [:optional, { type: :array, default: [], desc: 'Identifiers of optional categories (optional by force)' }]
15
+ ]
16
+ end
17
+
18
+ def declaration
19
+ "categories"
20
+ end
21
+
22
+ def runnable?; true; end
23
+ end
24
+
25
+ def run(options, args = [])
26
+ categories = all_categories
27
+ categories -= options[:optional] if options[:optional]
28
+
29
+ begin
30
+ Timeout::timeout(options[:timeout]) {
31
+ categories.each { |cat| fail "#{cat.inspect} is missing" unless client(options).model.get_by_id(cat, true) }
32
+ }
33
+ rescue => ex
34
+ puts "CATEGORIES CRITICAL - #{ex.message}"
35
+ puts ex.backtrace if options[:debug]
36
+ exit 2
37
+ end
38
+
39
+ puts 'CATEGORIES OK - All specified OCCI categories were found'
40
+ end
41
+
42
+ private
43
+
44
+ def all_categories
45
+ Nagios::Promoo::Occi::Probes::KindsProbe::CORE_KINDS + Nagios::Promoo::Occi::Probes::KindsProbe::INFRA_KINDS \
46
+ + Nagios::Promoo::Occi::Probes::MixinsProbe::INFRA_MIXINS + Nagios::Promoo::Occi::Probes::MixinsProbe::CONTEXT_MIXINS
47
+ end
48
+ end
@@ -1,5 +1,5 @@
1
1
  module Nagios
2
2
  module Promoo
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nagios-promoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Boris Parak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-10 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: occi-api
@@ -248,6 +248,7 @@ files:
248
248
  - lib/nagios/promoo/occi/master.rb
249
249
  - lib/nagios/promoo/occi/probes/.keep
250
250
  - lib/nagios/promoo/occi/probes/base_probe.rb
251
+ - lib/nagios/promoo/occi/probes/categories_probe.rb
251
252
  - lib/nagios/promoo/occi/probes/compute_probe.rb
252
253
  - lib/nagios/promoo/occi/probes/kinds_probe.rb
253
254
  - lib/nagios/promoo/occi/probes/mixins_probe.rb