bosh-monitor 1.3215.4.0 → 1.3232.0
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 +4 -4
- data/bin/listener +2 -2
- data/lib/bosh/monitor/agent_manager.rb +3 -3
- data/lib/bosh/monitor/director.rb +1 -1
- data/lib/bosh/monitor/event_processor.rb +3 -3
- data/lib/bosh/monitor/events/base.rb +2 -2
- data/lib/bosh/monitor/events/heartbeat.rb +2 -2
- data/lib/bosh/monitor/plugins/base.rb +2 -2
- data/lib/bosh/monitor/plugins/nats.rb +1 -1
- data/lib/bosh/monitor/runner.rb +3 -3
- data/lib/bosh/monitor/version.rb +1 -1
- data/lib/bosh/monitor/yaml_helper.rb +3 -3
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3bcdeeef95374432f1fe1d6ee8efdc6d9da7ced8
|
4
|
+
data.tar.gz: 85e1026bcde7b08580f8e936486d3e95bf0449d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a882736ebb07acabd5d1d6c77e209cff3440f0dc0176031cfbc9feb2938aab65bde42de1ffe22db70f3bc962ca5c73610243d2ce86c00db0da945e859754d2b6
|
7
|
+
data.tar.gz: 0d376ba3716b64b569c36cd7bd0ae0a6468ce62e3d01b2c92daf7e416354e43d0464dd14ef0a0967411e73a06288db34cddd34deb30e2c2c85d691e3b60a53c4
|
data/bin/listener
CHANGED
@@ -34,13 +34,13 @@ class Listener
|
|
34
34
|
@nats = NATS.connect(nats_client_options)
|
35
35
|
|
36
36
|
if nats_subject
|
37
|
-
puts "> NATS subject is set to
|
37
|
+
puts "> NATS subject is set to '#{nats_subject}'"
|
38
38
|
else
|
39
39
|
nats_subject = "bosh.hm.events"
|
40
40
|
end
|
41
41
|
|
42
42
|
if filter
|
43
|
-
puts "> Filter is set to
|
43
|
+
puts "> Filter is set to '#{filter}'"
|
44
44
|
end
|
45
45
|
|
46
46
|
puts "> Subscribing to events"
|
@@ -34,7 +34,7 @@ module Bosh::Monitor
|
|
34
34
|
class_name = name.to_s.split("_").map(&:capitalize).join
|
35
35
|
plugin_class = Bosh::Monitor::Plugins.const_get(class_name)
|
36
36
|
rescue NameError => e
|
37
|
-
raise PluginError, "Cannot find
|
37
|
+
raise PluginError, "Cannot find '#{name}' plugin"
|
38
38
|
end
|
39
39
|
|
40
40
|
plugin_class.new(options)
|
@@ -256,7 +256,7 @@ module Bosh::Monitor
|
|
256
256
|
when "shutdown"
|
257
257
|
on_shutdown(agent, message)
|
258
258
|
else
|
259
|
-
@logger.warn("No handler found for
|
259
|
+
@logger.warn("No handler found for '#{kind}' event")
|
260
260
|
end
|
261
261
|
|
262
262
|
rescue Yajl::ParseError => e
|
@@ -288,7 +288,7 @@ module Bosh::Monitor
|
|
288
288
|
end
|
289
289
|
|
290
290
|
def on_shutdown(agent, message)
|
291
|
-
@logger.info("Agent
|
291
|
+
@logger.info("Agent '#{agent.id}' shutting down...")
|
292
292
|
remove_agent(agent.id)
|
293
293
|
end
|
294
294
|
|
@@ -26,7 +26,7 @@ module Bosh::Monitor
|
|
26
26
|
status = http.response_header.http_status
|
27
27
|
|
28
28
|
if status != '200'
|
29
|
-
raise DirectorError, "Cannot get deployment
|
29
|
+
raise DirectorError, "Cannot get deployment '#{name}' from director at #{http.uri}: #{status} #{body}"
|
30
30
|
end
|
31
31
|
|
32
32
|
parse_json(body, Array)
|
@@ -12,7 +12,7 @@ module Bosh::Monitor
|
|
12
12
|
|
13
13
|
def add_plugin(plugin, event_kinds = [])
|
14
14
|
if plugin.respond_to?(:validate_options) && !plugin.validate_options
|
15
|
-
raise FatalError, "Invalid plugin options for
|
15
|
+
raise FatalError, "Invalid plugin options for '#{plugin.class}'"
|
16
16
|
end
|
17
17
|
|
18
18
|
@lock.synchronize do
|
@@ -33,7 +33,7 @@ module Bosh::Monitor
|
|
33
33
|
@events[kind] ||= {}
|
34
34
|
|
35
35
|
if @events[kind].has_key?(event.id)
|
36
|
-
@logger.debug("Ignoring duplicate #{event.kind}
|
36
|
+
@logger.debug("Ignoring duplicate #{event.kind} '#{event.id}'")
|
37
37
|
return true
|
38
38
|
end
|
39
39
|
# We don't really need to store event itself for the moment,
|
@@ -42,7 +42,7 @@ module Bosh::Monitor
|
|
42
42
|
end
|
43
43
|
|
44
44
|
if @plugins[kind].nil? || @plugins[kind].empty?
|
45
|
-
@logger.debug("No plugins are interested in
|
45
|
+
@logger.debug("No plugins are interested in '#{event.kind}' event")
|
46
46
|
return true
|
47
47
|
end
|
48
48
|
|
@@ -27,7 +27,7 @@ module Bosh::Monitor
|
|
27
27
|
when "alert"
|
28
28
|
klass = Bhm::Events::Alert
|
29
29
|
else
|
30
|
-
raise InvalidEvent, "Cannot find
|
30
|
+
raise InvalidEvent, "Cannot find '#{kind}' event handler"
|
31
31
|
end
|
32
32
|
|
33
33
|
event = klass.new(attributes)
|
@@ -62,7 +62,7 @@ module Bosh::Monitor
|
|
62
62
|
|
63
63
|
[:validate, :to_plain_text, :to_hash, :to_json, :metrics].each do |method|
|
64
64
|
define_method(method) do
|
65
|
-
raise FatalError, "
|
65
|
+
raise FatalError, "'#{method}' is not implemented by #{self.class}"
|
66
66
|
end
|
67
67
|
end
|
68
68
|
end
|
@@ -2,9 +2,9 @@ module Bosh::Monitor
|
|
2
2
|
module Events
|
3
3
|
class Heartbeat < Base
|
4
4
|
|
5
|
-
CORE_JOBS = Set.new(%w(cloud_controller dea health_manager nats router routerv2 stager uaa
|
5
|
+
CORE_JOBS = Set.new(%w(cloud_controller dea health_manager nats router routerv2 stager uaa))
|
6
6
|
|
7
|
-
SERVICE_JOBS_PREFIXES = %w(mysql mongodb
|
7
|
+
SERVICE_JOBS_PREFIXES = %w(mysql mongodb rabbit postgresql vblob).join("|")
|
8
8
|
SERVICE_JOBS_GATEWAY_REGEX = /(#{SERVICE_JOBS_PREFIXES})_gateway$/i
|
9
9
|
SERVICE_JOBS_NODE_REGEX = /(#{SERVICE_JOBS_PREFIXES})_node(.*)/i
|
10
10
|
|
@@ -16,11 +16,11 @@ module Bosh::Monitor
|
|
16
16
|
end
|
17
17
|
|
18
18
|
def run
|
19
|
-
raise FatalError, "
|
19
|
+
raise FatalError, "'run' method is not implemented in '#{self.class}'"
|
20
20
|
end
|
21
21
|
|
22
22
|
def process(event)
|
23
|
-
raise FatalError, "
|
23
|
+
raise FatalError, "'process' method is not implemented in '#{self.class}'"
|
24
24
|
end
|
25
25
|
end
|
26
26
|
end
|
data/lib/bosh/monitor/runner.rb
CHANGED
@@ -78,7 +78,7 @@ module Bosh::Monitor
|
|
78
78
|
}
|
79
79
|
|
80
80
|
Bhm.nats = NATS.connect(nats_client_options) do
|
81
|
-
@logger.info("Connected to NATS at
|
81
|
+
@logger.info("Connected to NATS at '#{@mbus.endpoint}'")
|
82
82
|
end
|
83
83
|
end
|
84
84
|
|
@@ -151,9 +151,9 @@ module Bosh::Monitor
|
|
151
151
|
deployments.each do |deployment|
|
152
152
|
deployment_name = deployment["name"]
|
153
153
|
|
154
|
-
@logger.info "Found deployment
|
154
|
+
@logger.info "Found deployment '#{deployment_name}'"
|
155
155
|
|
156
|
-
@logger.debug "Fetching VMs information for
|
156
|
+
@logger.debug "Fetching VMs information for '#{deployment_name}'..."
|
157
157
|
vms = @director.get_deployment_vms(deployment_name)
|
158
158
|
|
159
159
|
@agent_manager.sync_agents(deployment_name, vms)
|
data/lib/bosh/monitor/version.rb
CHANGED
@@ -2,16 +2,16 @@ module Bosh::Monitor
|
|
2
2
|
module YamlHelper
|
3
3
|
|
4
4
|
def load_yaml_file(path, expected_type = Hash)
|
5
|
-
raise(ConfigError, "Cannot find file
|
5
|
+
raise(ConfigError, "Cannot find file '#{path}'") unless File.exists?(path)
|
6
6
|
yaml = Psych.load_file(path)
|
7
7
|
|
8
8
|
if expected_type && !yaml.is_a?(expected_type)
|
9
|
-
raise ConfigError, "Incorrect file format in
|
9
|
+
raise ConfigError, "Incorrect file format in '#{path}', #{expected_type} expected"
|
10
10
|
end
|
11
11
|
|
12
12
|
yaml
|
13
13
|
rescue SystemCallError => e
|
14
|
-
raise ConfigError, "Cannot load YAML file at
|
14
|
+
raise ConfigError, "Cannot load YAML file at '#{path}': #{e}"
|
15
15
|
end
|
16
16
|
|
17
17
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh-monitor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3232.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- VMware
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: eventmachine
|
@@ -128,14 +128,14 @@ dependencies:
|
|
128
128
|
requirements:
|
129
129
|
- - "~>"
|
130
130
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
131
|
+
version: 1.21.0
|
132
132
|
type: :runtime
|
133
133
|
prerelease: false
|
134
134
|
version_requirements: !ruby/object:Gem::Requirement
|
135
135
|
requirements:
|
136
136
|
- - "~>"
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
138
|
+
version: 1.21.0
|
139
139
|
- !ruby/object:Gem::Dependency
|
140
140
|
name: cf-uaa-lib
|
141
141
|
requirement: !ruby/object:Gem::Requirement
|