nagios-promoo 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/nagios/promoo/occi/probes/categories_probe.rb +48 -0
- data/lib/nagios/promoo/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 586b15304cbf0325aa52571802a4eecb4c2375f7
|
4
|
+
data.tar.gz: ed96a9964cfd2d7ffba0e293437d14965a7d88a6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
+
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-
|
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
|