cloudscale 0.0.8 → 0.0.9
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/cloudscale +5 -0
- data/lib/cloudscale/monitor/agent/agent.rb +8 -2
- data/lib/cloudscale/monitor/reporter/influxdb_reporter.rb +29 -5
- data/lib/cloudscale/plugins/mongo/preops/mongodb_preop.rb +12 -4
- data/lib/cloudscale/plugins/mysql/data/mysql_chart.json +506 -0
- data/lib/cloudscale/plugins/mysql/data/mysql_menu.json +35 -0
- data/lib/cloudscale/plugins/mysql/mysql_counters.rb +90 -0
- data/lib/cloudscale/plugins/mysql/mysql_general_status.rb +119 -0
- data/lib/cloudscale/plugins/mysql/mysql_innodb.rb +113 -0
- data/lib/cloudscale/plugins/mysql/mysql_querycache.rb +59 -0
- data/lib/cloudscale/plugins/mysql/preops/mysql_preop.rb +95 -0
- data/lib/cloudscale/plugins/postgres/preops/postgres_preop.rb +12 -4
- data/lib/cloudscale/plugins/redis/data/redis_chart.json +110 -0
- data/lib/cloudscale/plugins/redis/data/redis_menu.json +17 -0
- data/lib/cloudscale/plugins/redis/preops/redis_preop.rb +117 -0
- data/lib/cloudscale/plugins/redis/redis_server_status.rb +227 -0
- data/lib/cloudscale/rest/rest_client.rb +14 -8
- data/lib/cloudscale/rest/rest_client_helper.rb +23 -16
- data/lib/cloudscale/schedule.rb +1 -0
- data/lib/cloudscale/store/agent/agent.store +1 -1
- data/lib/cloudscale/store/agent/agent_instance.store +11 -0
- data/lib/cloudscale/store/agent/influxdb.store +1 -1
- data/lib/cloudscale/version.rb +1 -1
- data/lib/store/plugin/host +1 -0
- data/lib/store/plugin/mongo-connect-timeout +1 -0
- data/lib/store/plugin/mongo-db +1 -0
- data/lib/store/plugin/mongo-host +1 -0
- data/lib/store/plugin/mongo-op-timeout +1 -0
- data/lib/store/plugin/mongo-password +1 -0
- data/lib/store/plugin/mongo-port +2 -0
- data/lib/store/plugin/mongo-ssl +2 -0
- data/lib/store/plugin/mongo-username +1 -0
- data/lib/store/plugin/mysql-db +0 -0
- data/lib/store/plugin/mysql-host +0 -0
- data/lib/store/plugin/mysql-password +0 -0
- data/lib/store/plugin/mysql-port +1 -0
- data/lib/store/plugin/mysql-username +0 -0
- data/lib/store/plugin/port +1 -0
- data/lib/store/plugin/postgres-db +0 -0
- data/lib/store/plugin/postgres-host +0 -0
- data/lib/store/plugin/postgres-password +0 -0
- data/lib/store/plugin/postgres-port +1 -0
- data/lib/store/plugin/postgres-username +0 -0
- data/lib/store/plugin/redis-db +0 -0
- data/lib/store/plugin/redis-host +0 -0
- data/lib/store/plugin/redis-password +0 -0
- data/lib/store/plugin/redis-port +1 -0
- data/lib/store/plugin/redis-reconnect-attempts +1 -0
- data/lib/store/plugin/redis-timeout +1 -0
- data/lib/store/plugin/redis-username +0 -0
- data/lib/store/plugin/token +1 -0
- metadata +45 -11
- data/bin/autospec +0 -16
- data/bin/bundler +0 -16
- data/bin/htmldiff +0 -16
- data/bin/ldiff +0 -16
- data/bin/monitor +0 -16
- data/bin/rake +0 -16
- data/bin/restclient +0 -16
- data/bin/rspec +0 -16
@@ -42,7 +42,12 @@ class RestClientWrapper < RestClientHelper
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def get(entity, id)
|
45
|
-
uri =
|
45
|
+
uri = uri_with_id(entity, id)
|
46
|
+
load(uri)
|
47
|
+
end
|
48
|
+
|
49
|
+
def get_with_path(entity, id, path)
|
50
|
+
uri = uri_with_id_and_path(entity, id, path)
|
46
51
|
load(uri)
|
47
52
|
end
|
48
53
|
|
@@ -69,9 +74,8 @@ class RestClientWrapper < RestClientHelper
|
|
69
74
|
RestClient.get(searchQuery, header) { | response, request, result |
|
70
75
|
case response.code
|
71
76
|
when 200
|
72
|
-
|
73
|
-
|
74
|
-
return responseBody["content"][0]
|
77
|
+
if (!response.body.empty?)
|
78
|
+
return JSON.parse(response.body)
|
75
79
|
end
|
76
80
|
else
|
77
81
|
puts request.to_yaml
|
@@ -91,7 +95,9 @@ class RestClientWrapper < RestClientHelper
|
|
91
95
|
RestClient.get(searchQuery, header) { | response, request, result |
|
92
96
|
case response.code
|
93
97
|
when 200
|
94
|
-
|
98
|
+
if (!response.body.empty?)
|
99
|
+
return JSON.parse(response.body)
|
100
|
+
end
|
95
101
|
else
|
96
102
|
puts request.to_yaml
|
97
103
|
puts response.code
|
@@ -127,7 +133,7 @@ class RestClientWrapper < RestClientHelper
|
|
127
133
|
hash = value.to_dh
|
128
134
|
end
|
129
135
|
|
130
|
-
RestClient.put(
|
136
|
+
RestClient.put(uri_with_id(entity, id), hash.to_json, header) { | response, request, result |
|
131
137
|
case response.code
|
132
138
|
when 200, 204
|
133
139
|
if (response.body != nil && response.body.length > 2)
|
@@ -148,7 +154,7 @@ class RestClientWrapper < RestClientHelper
|
|
148
154
|
hash = value.to_dh
|
149
155
|
end
|
150
156
|
|
151
|
-
RestClient.patch(
|
157
|
+
RestClient.patch(uri_with_id(entity, id), hash.to_json, header) { | response, request, result |
|
152
158
|
case response.code
|
153
159
|
when 200, 204
|
154
160
|
if (response.body != nil && response.body.length > 2)
|
@@ -165,7 +171,7 @@ class RestClientWrapper < RestClientHelper
|
|
165
171
|
def delete(entity, id)
|
166
172
|
id = id.to_s.gsub('{?projection}','')
|
167
173
|
|
168
|
-
RestClient.delete(
|
174
|
+
RestClient.delete(uri_with_id(entity, id), header) { | response, request, result |
|
169
175
|
case response.code
|
170
176
|
when 200, 204
|
171
177
|
else
|
@@ -5,66 +5,73 @@
|
|
5
5
|
#
|
6
6
|
##
|
7
7
|
class RestClientHelper
|
8
|
-
|
8
|
+
|
9
9
|
def load_token(token)
|
10
10
|
db = FSDB::Database.new("#{File.dirname(__FILE__)}/../store/plugin/")
|
11
11
|
return db[token]
|
12
12
|
end
|
13
|
-
|
13
|
+
|
14
14
|
def uri(entity)
|
15
15
|
if (!endpoint.to_s.end_with? '/')
|
16
16
|
@endpoint << '/'
|
17
17
|
end
|
18
18
|
String::new(@endpoint + entity)
|
19
19
|
end
|
20
|
-
|
20
|
+
|
21
21
|
def uri_with_params(entity, params)
|
22
22
|
if (!endpoint.to_s.end_with? '/')
|
23
23
|
@endpoint << '/'
|
24
24
|
end
|
25
|
-
|
25
|
+
|
26
26
|
uri = String::new(@endpoint + entity)
|
27
27
|
if (params.is_a?(Hash))
|
28
28
|
uri << '?'
|
29
29
|
params.each { | key, value|
|
30
|
-
uri += key.to_s + '=' + value.to_s + '&'
|
30
|
+
uri += key.to_s + '=' + value.to_s + '&'
|
31
31
|
}
|
32
32
|
end
|
33
33
|
return uri
|
34
34
|
end
|
35
|
-
|
36
|
-
def
|
35
|
+
|
36
|
+
def uri_with_id(entity, id)
|
37
37
|
if (!endpoint.to_s.end_with? '/')
|
38
38
|
@endpoint << '/'
|
39
39
|
end
|
40
|
-
String::new(@endpoint + entity + '/' + id.to_s)
|
40
|
+
String::new(@endpoint + entity + '/' + id.to_s)
|
41
41
|
end
|
42
|
-
|
42
|
+
|
43
|
+
def uri_with_id_and_path(entity, id, path)
|
44
|
+
if (!endpoint.to_s.end_with? '/')
|
45
|
+
@endpoint << '/'
|
46
|
+
end
|
47
|
+
String::new(@endpoint + entity + '/' + id.to_s + '/' + path)
|
48
|
+
end
|
49
|
+
|
43
50
|
def self.load_entity_id(entity)
|
44
51
|
if (entity != nil && entity["links"].is_a?(Array))
|
45
52
|
entity["links"].each { | link |
|
46
53
|
if (link["rel"] == "self")
|
47
54
|
return link["href"][link["href"].rindex('/') + 1, link["href"].length]
|
48
|
-
end
|
55
|
+
end
|
49
56
|
}
|
50
57
|
end
|
51
58
|
end
|
52
|
-
|
59
|
+
|
53
60
|
def self.load_entity_ref(entity)
|
54
61
|
if (entity != nil && entity["links"].is_a?(Array))
|
55
62
|
entity["links"].each { | link |
|
56
63
|
if (link["rel"] == "self")
|
57
64
|
return link
|
58
|
-
end
|
65
|
+
end
|
59
66
|
}
|
60
67
|
end
|
61
68
|
end
|
62
|
-
|
69
|
+
|
63
70
|
def removeLinks(hash, key)
|
64
71
|
if (hash.key?(key))
|
65
72
|
hash.tap { | x |
|
66
|
-
x.delete(key)
|
67
|
-
}
|
73
|
+
x.delete(key)
|
74
|
+
}
|
68
75
|
end
|
69
|
-
end
|
76
|
+
end
|
70
77
|
end
|
data/lib/cloudscale/schedule.rb
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
---
|
2
|
+
agent: http://localhost:8080/service/agents/5315cf2d4d1a44fb9d21b1f9
|
3
|
+
agentInstanceId: c7f9c3c2dc4d6f3e4cd46b4dda714115
|
4
|
+
token: e2FsZz1IUzI1NiwgdHlwPUNUfQ.e3Y9MCwgZD1tb25pdG9yaW5nLCBpYXQ9MTQwNDc1NzMyNH0.rG0biCuH_-X1vulEr19H2m42i4DGRR8PGwgXastyk3Q
|
5
|
+
server: jhiemer-evoila.fritz.box
|
6
|
+
settings: !ruby/object:Cloudscale::Monitor::Settings
|
7
|
+
measurementCollectionInterval: 15
|
8
|
+
coredataCollectionInterval: 0
|
9
|
+
tableCollectionInterval: 1500
|
10
|
+
reportingInterval: 5
|
11
|
+
started: 1442172827000
|
data/lib/cloudscale/version.rb
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
I"localhost:ET
|
@@ -0,0 +1 @@
|
|
1
|
+
I"30:EF
|
@@ -0,0 +1 @@
|
|
1
|
+
I"cloudscale:ET
|
@@ -0,0 +1 @@
|
|
1
|
+
I"172.16.248.144:ET
|
@@ -0,0 +1 @@
|
|
1
|
+
I"30:EF
|
@@ -0,0 +1 @@
|
|
1
|
+
I"cloudscale:ET
|
@@ -0,0 +1 @@
|
|
1
|
+
I"cloudscale:ET
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
I" 3306:EF
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
I" 8080:ET
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
I" 5432:EF
|
Binary file
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
I" 6379:EF
|
@@ -0,0 +1 @@
|
|
1
|
+
I"5:EF
|
@@ -0,0 +1 @@
|
|
1
|
+
I"30:EF
|
Binary file
|
@@ -0,0 +1 @@
|
|
1
|
+
I"{e2FsZz1IUzI1NiwgdHlwPUNUfQ.e3Y9MCwgZD1tb25pdG9yaW5nLCBpYXQ9MTQwNDc1NzMyNH0.rG0biCuH_-X1vulEr19H2m42i4DGRR8PGwgXastyk3Q:ET
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudscale
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Johannes Hiemer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -195,20 +195,14 @@ dependencies:
|
|
195
195
|
description: A Monitoring Client for Cloud Infrastructure provided by evoila.de
|
196
196
|
email:
|
197
197
|
- jhiemer@cloudscale.de
|
198
|
-
executables:
|
198
|
+
executables:
|
199
|
+
- cloudscale
|
199
200
|
extensions: []
|
200
201
|
extra_rdoc_files: []
|
201
202
|
files:
|
202
203
|
- LICENSE.txt
|
203
204
|
- README.md
|
204
|
-
- bin/
|
205
|
-
- bin/bundler
|
206
|
-
- bin/htmldiff
|
207
|
-
- bin/ldiff
|
208
|
-
- bin/monitor
|
209
|
-
- bin/rake
|
210
|
-
- bin/restclient
|
211
|
-
- bin/rspec
|
205
|
+
- bin/cloudscale
|
212
206
|
- lib/cloudscale.rb
|
213
207
|
- lib/cloudscale/monitor/agent/agent.rb
|
214
208
|
- lib/cloudscale/monitor/model/agent/agent_instance.rb
|
@@ -228,6 +222,13 @@ files:
|
|
228
222
|
- lib/cloudscale/plugins/mongo/mongo_replica_status.rb
|
229
223
|
- lib/cloudscale/plugins/mongo/mongo_server_status.rb
|
230
224
|
- lib/cloudscale/plugins/mongo/preops/mongodb_preop.rb
|
225
|
+
- lib/cloudscale/plugins/mysql/data/mysql_chart.json
|
226
|
+
- lib/cloudscale/plugins/mysql/data/mysql_menu.json
|
227
|
+
- lib/cloudscale/plugins/mysql/mysql_counters.rb
|
228
|
+
- lib/cloudscale/plugins/mysql/mysql_general_status.rb
|
229
|
+
- lib/cloudscale/plugins/mysql/mysql_innodb.rb
|
230
|
+
- lib/cloudscale/plugins/mysql/mysql_querycache.rb
|
231
|
+
- lib/cloudscale/plugins/mysql/preops/mysql_preop.rb
|
231
232
|
- lib/cloudscale/plugins/os/data/os_chart.json
|
232
233
|
- lib/cloudscale/plugins/os/data/os_menu.json
|
233
234
|
- lib/cloudscale/plugins/os/preops/os_preop.rb
|
@@ -244,16 +245,49 @@ files:
|
|
244
245
|
- lib/cloudscale/plugins/postgres/postgres_server_status.rb
|
245
246
|
- lib/cloudscale/plugins/postgres/preops/postgres_preop.rb
|
246
247
|
- lib/cloudscale/plugins/preops/plugin_preop.rb
|
248
|
+
- lib/cloudscale/plugins/redis/data/redis_chart.json
|
249
|
+
- lib/cloudscale/plugins/redis/data/redis_menu.json
|
250
|
+
- lib/cloudscale/plugins/redis/preops/redis_preop.rb
|
251
|
+
- lib/cloudscale/plugins/redis/redis_server_status.rb
|
247
252
|
- lib/cloudscale/registry.rb
|
248
253
|
- lib/cloudscale/rest/rest_client.rb
|
249
254
|
- lib/cloudscale/rest/rest_client_helper.rb
|
250
255
|
- lib/cloudscale/schedule.rb
|
251
256
|
- lib/cloudscale/store/agent/agent.store
|
257
|
+
- lib/cloudscale/store/agent/agent_instance.store
|
252
258
|
- lib/cloudscale/store/agent/influxdb.store
|
253
259
|
- lib/cloudscale/store/plugin/host
|
254
260
|
- lib/cloudscale/store/plugin/port
|
255
261
|
- lib/cloudscale/store/plugin/token
|
256
262
|
- lib/cloudscale/version.rb
|
263
|
+
- lib/store/plugin/host
|
264
|
+
- lib/store/plugin/mongo-connect-timeout
|
265
|
+
- lib/store/plugin/mongo-db
|
266
|
+
- lib/store/plugin/mongo-host
|
267
|
+
- lib/store/plugin/mongo-op-timeout
|
268
|
+
- lib/store/plugin/mongo-password
|
269
|
+
- lib/store/plugin/mongo-port
|
270
|
+
- lib/store/plugin/mongo-ssl
|
271
|
+
- lib/store/plugin/mongo-username
|
272
|
+
- lib/store/plugin/mysql-db
|
273
|
+
- lib/store/plugin/mysql-host
|
274
|
+
- lib/store/plugin/mysql-password
|
275
|
+
- lib/store/plugin/mysql-port
|
276
|
+
- lib/store/plugin/mysql-username
|
277
|
+
- lib/store/plugin/port
|
278
|
+
- lib/store/plugin/postgres-db
|
279
|
+
- lib/store/plugin/postgres-host
|
280
|
+
- lib/store/plugin/postgres-password
|
281
|
+
- lib/store/plugin/postgres-port
|
282
|
+
- lib/store/plugin/postgres-username
|
283
|
+
- lib/store/plugin/redis-db
|
284
|
+
- lib/store/plugin/redis-host
|
285
|
+
- lib/store/plugin/redis-password
|
286
|
+
- lib/store/plugin/redis-port
|
287
|
+
- lib/store/plugin/redis-reconnect-attempts
|
288
|
+
- lib/store/plugin/redis-timeout
|
289
|
+
- lib/store/plugin/redis-username
|
290
|
+
- lib/store/plugin/token
|
257
291
|
- lib/test/rest/rest_client_test.rb
|
258
292
|
- lib/test/sigar/sigar_test.rb
|
259
293
|
homepage: http://www.evoila.de
|
data/bin/autospec
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'autospec' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('rspec-core', 'autospec')
|
data/bin/bundler
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'bundler' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('bundler', 'bundler')
|
data/bin/htmldiff
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'htmldiff' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('diff-lcs', 'htmldiff')
|
data/bin/ldiff
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'ldiff' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('diff-lcs', 'ldiff')
|
data/bin/monitor
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
#
|
3
|
-
# This file was generated by Bundler.
|
4
|
-
#
|
5
|
-
# The application 'monitor' is installed as part of a gem, and
|
6
|
-
# this file is here to facilitate running it.
|
7
|
-
#
|
8
|
-
|
9
|
-
require 'pathname'
|
10
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
-
Pathname.new(__FILE__).realpath)
|
12
|
-
|
13
|
-
require 'rubygems'
|
14
|
-
require 'bundler/setup'
|
15
|
-
|
16
|
-
load Gem.bin_path('cloudscale', 'monitor')
|