process_monitoring 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
@@ -10,8 +10,9 @@ require 'params'
|
|
10
10
|
EventMachine.schedule do
|
11
11
|
trap("INT") do
|
12
12
|
puts "Caught SIGINT"
|
13
|
-
EventMachine
|
14
|
-
|
13
|
+
puts "EventMachine:#{EventMachine}"
|
14
|
+
# EventMachine.stop # this is useless
|
15
|
+
exit # exit # this stops the EventMachine
|
15
16
|
end
|
16
17
|
end
|
17
18
|
|
@@ -24,9 +25,11 @@ module MonitoringInfo
|
|
24
25
|
class MonitoringInfo
|
25
26
|
attr_reader :thread
|
26
27
|
|
27
|
-
def initialize(
|
28
|
-
@
|
29
|
-
|
28
|
+
def initialize()
|
29
|
+
@web_interface = Sinatra.new {
|
30
|
+
set :bind, '0.0.0.0'
|
31
|
+
get('/') { MonitoringInfo.get_json(Params['process_vars'].clone) }
|
32
|
+
}
|
30
33
|
@web_interface.set(:port, Params['process_monitoring_web_port'])
|
31
34
|
@thread = Thread.new do
|
32
35
|
@web_interface.run!
|
@@ -38,14 +41,10 @@ module MonitoringInfo
|
|
38
41
|
|
39
42
|
entries = []
|
40
43
|
hash.each do |key, value|
|
41
|
-
|
42
|
-
entries << "\"#{key}\": \"#{value}\""
|
43
|
-
else
|
44
|
-
entries << "\"#{key}\": #{value}"
|
45
|
-
end
|
44
|
+
entries << "{#{key}:#{value}}"
|
46
45
|
end
|
47
46
|
|
48
|
-
return
|
47
|
+
return entries.join(" , ")
|
49
48
|
end
|
50
49
|
|
51
50
|
def self.get_html (hash, opts = {})
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: process_monitoring
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: eventmachine
|