nagios-promoo 1.7.0 → 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +5 -0
- data/lib/nagios/promoo/appdb/probes/appliances_probe.rb +3 -3
- data/lib/nagios/promoo/appdb/probes/base_probe.rb +6 -3
- data/lib/nagios/promoo/appdb/probes/sync_probe.rb +5 -5
- data/lib/nagios/promoo/appdb/version.rb +1 -1
- data/lib/nagios/promoo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cc2cd6e6e2a3d9a76c0172908761abaea1ee0048
|
4
|
+
data.tar.gz: 68593940462b359328c6987d9ea9bc30bfe48889
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 07f8e8873d47018aa85c6ba1b128e0f087eba95a1d744237f0981fca96a013cd054bdcffa52d9df268c4a38dc2f65b457bef070ec5ee2943485a282f24ecc75d
|
7
|
+
data.tar.gz: 1a7498d407f73530ca96d68630c0c48727f5c160f2c74fcc8f1230b4411bae1aca3f805cd66a0199b661f936c73295f835e7a8745246da2e331b234c0a04a2e9
|
data/History.md
CHANGED
@@ -37,13 +37,13 @@ module Nagios
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def run(_args = [])
|
40
|
-
count = Timeout.timeout(options[:timeout]) { appliances_by_endpoint
|
40
|
+
count = Timeout.timeout(options[:timeout]) { appliances_by_endpoint.count }
|
41
41
|
if count < 1
|
42
|
-
puts "APPLIANCES CRITICAL - No appliances found for VO #{
|
42
|
+
puts "APPLIANCES CRITICAL - No appliances found for VO #{vo} in AppDB"
|
43
43
|
exit 2
|
44
44
|
end
|
45
45
|
|
46
|
-
puts "APPLIANCES OK - Found #{count} appliances for VO #{
|
46
|
+
puts "APPLIANCES OK - Found #{count} appliances for VO #{vo} in AppDB"
|
47
47
|
rescue => ex
|
48
48
|
puts "APPLIANCES UNKNOWN - #{ex.message}"
|
49
49
|
puts ex.backtrace if options[:debug]
|
@@ -33,15 +33,17 @@ module Nagios
|
|
33
33
|
}
|
34
34
|
|.freeze
|
35
35
|
|
36
|
-
attr_reader :options, :endpoint
|
36
|
+
attr_reader :options, :endpoint, :vo
|
37
37
|
|
38
38
|
def initialize(options)
|
39
39
|
@options = options
|
40
|
-
@endpoint = options
|
40
|
+
@endpoint = options.fetch(:endpoint)
|
41
|
+
@vo = options.fetch(:vo, nil)
|
41
42
|
end
|
42
43
|
|
43
44
|
def sizes_by_endpoint
|
44
45
|
return @_sizes if @_sizes
|
46
|
+
raise '`endpoint` is a mandatory argument' if endpoint.blank?
|
45
47
|
|
46
48
|
query = GQL_SIZES_BY_ENDPOINT.gsub('$$ENDPOINT$$', endpoint)
|
47
49
|
@_sizes = make(query)['data']['siteServiceTemplates']['items']
|
@@ -50,8 +52,9 @@ module Nagios
|
|
50
52
|
@_sizes
|
51
53
|
end
|
52
54
|
|
53
|
-
def appliances_by_endpoint
|
55
|
+
def appliances_by_endpoint
|
54
56
|
return @_appliances if @_appliances
|
57
|
+
raise '`endpoint` and `vo` are mandatory arguments' if endpoint.blank? || vo.blank?
|
55
58
|
|
56
59
|
query = GQL_APPLIANCES_BY_ENDPOINT.gsub('$$ENDPOINT$$', endpoint).gsub('$$VO$$', vo)
|
57
60
|
@_appliances = make(query)['data']['siteServiceImages']['items']
|
@@ -76,20 +76,20 @@ module Nagios
|
|
76
76
|
if wrong.any?
|
77
77
|
if (@_last_update + options[:critical_after].hours) < Time.now
|
78
78
|
puts "SYNC CRITICAL - Appliance(s) #{wrong.inspect} missing " \
|
79
|
-
"or outdated in #{
|
79
|
+
"or outdated in #{vo.inspect} " \
|
80
80
|
"more than #{options[:critical_after]} hours after list publication [#{@_last_update}]"
|
81
81
|
exit 2
|
82
82
|
end
|
83
83
|
|
84
84
|
if (@_last_update + options[:warning_after].hours) < Time.now
|
85
85
|
puts "SYNC WARNING - Appliance(s) #{wrong.inspect} missing " \
|
86
|
-
"or outdated in #{
|
86
|
+
"or outdated in #{vo.inspect} " \
|
87
87
|
"more than #{options[:warning_after]} hours after list publication [#{@_last_update}]"
|
88
88
|
exit 1
|
89
89
|
end
|
90
90
|
end
|
91
91
|
|
92
|
-
puts "SYNC OK - All appliances registered in #{
|
92
|
+
puts "SYNC OK - All appliances registered in #{vo.inspect} " \
|
93
93
|
"are available [#{@_results[:expected].count}]"
|
94
94
|
rescue => ex
|
95
95
|
puts "SYNC UNKNOWN - #{ex.message}"
|
@@ -104,7 +104,7 @@ module Nagios
|
|
104
104
|
mpuri_versionless = versionless_mpuri(hv_image['ad:mpuri'])
|
105
105
|
@_results[:expected] << mpuri_versionless
|
106
106
|
|
107
|
-
matching = appliances_by_endpoint
|
107
|
+
matching = appliances_by_endpoint.detect do |appl|
|
108
108
|
versionless_mpuri(appl['applicationEnvironmentRepository']) == mpuri_versionless
|
109
109
|
end
|
110
110
|
|
@@ -152,7 +152,7 @@ module Nagios
|
|
152
152
|
end
|
153
153
|
|
154
154
|
def list_url
|
155
|
-
IMAGE_LIST_TEMPLATE.gsub('$$TOKEN$$', options[:token]).gsub('$$VO$$',
|
155
|
+
IMAGE_LIST_TEMPLATE.gsub('$$TOKEN$$', options[:token]).gsub('$$VO$$', vo)
|
156
156
|
end
|
157
157
|
|
158
158
|
def normalize_mpuri(mpuri)
|
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: 1.7.
|
4
|
+
version: 1.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Parak
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-11-
|
11
|
+
date: 2017-11-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|