rubix 0.5.9 → 0.5.13
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bin/zabbix_api +2 -2
- data/lib/rubix/models/host.rb +1 -0
- metadata +145 -182
- data/spec/test.yml +0 -11
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.13
|
data/bin/zabbix_api
CHANGED
@@ -31,13 +31,13 @@ end
|
|
31
31
|
def perform_query
|
32
32
|
begin
|
33
33
|
method = Settings.rest[0]
|
34
|
-
params = MultiJson.
|
34
|
+
params = MultiJson.load(Settings.rest[1])
|
35
35
|
response = Rubix.connection.request(method, params)
|
36
36
|
|
37
37
|
if Settings[:pretty]
|
38
38
|
puts MultiJson.dump(response.parsed, :pretty => true)
|
39
39
|
else
|
40
|
-
puts response.parsed
|
40
|
+
puts MultiJson.dump(response.parsed)
|
41
41
|
end
|
42
42
|
exit(0)
|
43
43
|
rescue MultiJson::DecodeError => e
|
data/lib/rubix/models/host.rb
CHANGED
@@ -175,6 +175,7 @@ module Rubix
|
|
175
175
|
|
176
176
|
def self.build host
|
177
177
|
host['profile'].delete('hostid') if host.is_a?(Hash) && host['profile'].is_a?(Hash) && host['profile']['hostid']
|
178
|
+
host.delete('profile') if host.is_a?(Hash) && host['profile'].is_a?(Array)
|
178
179
|
new({
|
179
180
|
:id => host[id_field].to_i,
|
180
181
|
:name => host['host'],
|
metadata
CHANGED
@@ -1,238 +1,198 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubix
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.9
|
3
|
+
version: !ruby/object:Gem::Version
|
5
4
|
prerelease:
|
5
|
+
version: 0.5.13
|
6
6
|
platform: ruby
|
7
|
-
authors:
|
7
|
+
authors:
|
8
8
|
- Dhruv Bansal
|
9
9
|
- Infochimps
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
|
14
|
+
date: 2012-08-17 00:00:00 Z
|
15
|
+
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
16
17
|
name: rake
|
17
|
-
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
18
19
|
none: false
|
19
|
-
requirements:
|
20
|
-
- -
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version:
|
20
|
+
requirements:
|
21
|
+
- - ">="
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: "0"
|
23
24
|
type: :development
|
24
25
|
prerelease: false
|
25
|
-
version_requirements:
|
26
|
-
|
27
|
-
requirements:
|
28
|
-
- - ! '>='
|
29
|
-
- !ruby/object:Gem::Version
|
30
|
-
version: '0'
|
31
|
-
- !ruby/object:Gem::Dependency
|
26
|
+
version_requirements: *id001
|
27
|
+
- !ruby/object:Gem::Dependency
|
32
28
|
name: rspec
|
33
|
-
requirement: !ruby/object:Gem::Requirement
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
34
30
|
none: false
|
35
|
-
requirements:
|
36
|
-
- -
|
37
|
-
- !ruby/object:Gem::Version
|
38
|
-
version:
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: "0"
|
39
35
|
type: :development
|
40
36
|
prerelease: false
|
41
|
-
version_requirements:
|
42
|
-
|
43
|
-
requirements:
|
44
|
-
- - ! '>='
|
45
|
-
- !ruby/object:Gem::Version
|
46
|
-
version: '0'
|
47
|
-
- !ruby/object:Gem::Dependency
|
37
|
+
version_requirements: *id002
|
38
|
+
- !ruby/object:Gem::Dependency
|
48
39
|
name: mysql2
|
49
|
-
requirement: !ruby/object:Gem::Requirement
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
50
41
|
none: false
|
51
|
-
requirements:
|
52
|
-
- -
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version:
|
42
|
+
requirements:
|
43
|
+
- - ">="
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: "0"
|
55
46
|
type: :development
|
56
47
|
prerelease: false
|
57
|
-
version_requirements:
|
58
|
-
|
59
|
-
requirements:
|
60
|
-
- - ! '>='
|
61
|
-
- !ruby/object:Gem::Version
|
62
|
-
version: '0'
|
63
|
-
- !ruby/object:Gem::Dependency
|
48
|
+
version_requirements: *id003
|
49
|
+
- !ruby/object:Gem::Dependency
|
64
50
|
name: oj
|
65
|
-
requirement: !ruby/object:Gem::Requirement
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
66
52
|
none: false
|
67
|
-
requirements:
|
68
|
-
- -
|
69
|
-
- !ruby/object:Gem::Version
|
70
|
-
version:
|
53
|
+
requirements:
|
54
|
+
- - ">="
|
55
|
+
- !ruby/object:Gem::Version
|
56
|
+
version: "0"
|
71
57
|
type: :development
|
72
58
|
prerelease: false
|
73
|
-
version_requirements:
|
74
|
-
|
75
|
-
requirements:
|
76
|
-
- - ! '>='
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
version: '0'
|
79
|
-
- !ruby/object:Gem::Dependency
|
59
|
+
version_requirements: *id004
|
60
|
+
- !ruby/object:Gem::Dependency
|
80
61
|
name: chef
|
81
|
-
requirement: !ruby/object:Gem::Requirement
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
82
63
|
none: false
|
83
|
-
requirements:
|
84
|
-
- -
|
85
|
-
- !ruby/object:Gem::Version
|
86
|
-
version:
|
64
|
+
requirements:
|
65
|
+
- - ">="
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: "0"
|
87
68
|
type: :runtime
|
88
69
|
prerelease: false
|
89
|
-
version_requirements:
|
90
|
-
|
91
|
-
requirements:
|
92
|
-
- - ! '>='
|
93
|
-
- !ruby/object:Gem::Version
|
94
|
-
version: '0'
|
95
|
-
- !ruby/object:Gem::Dependency
|
70
|
+
version_requirements: *id005
|
71
|
+
- !ruby/object:Gem::Dependency
|
96
72
|
name: multi_json
|
97
|
-
requirement: !ruby/object:Gem::Requirement
|
73
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
98
74
|
none: false
|
99
|
-
requirements:
|
100
|
-
- -
|
101
|
-
- !ruby/object:Gem::Version
|
102
|
-
version:
|
75
|
+
requirements:
|
76
|
+
- - ">="
|
77
|
+
- !ruby/object:Gem::Version
|
78
|
+
version: "0"
|
103
79
|
type: :runtime
|
104
80
|
prerelease: false
|
105
|
-
version_requirements:
|
106
|
-
|
107
|
-
requirements:
|
108
|
-
- - ! '>='
|
109
|
-
- !ruby/object:Gem::Version
|
110
|
-
version: '0'
|
111
|
-
- !ruby/object:Gem::Dependency
|
81
|
+
version_requirements: *id006
|
82
|
+
- !ruby/object:Gem::Dependency
|
112
83
|
name: configliere
|
113
|
-
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
114
85
|
none: false
|
115
|
-
requirements:
|
116
|
-
- -
|
117
|
-
- !ruby/object:Gem::Version
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
118
89
|
version: 0.4.16
|
119
90
|
type: :runtime
|
120
91
|
prerelease: false
|
121
|
-
version_requirements:
|
122
|
-
|
123
|
-
requirements:
|
124
|
-
- - ! '>='
|
125
|
-
- !ruby/object:Gem::Version
|
126
|
-
version: 0.4.16
|
127
|
-
- !ruby/object:Gem::Dependency
|
92
|
+
version_requirements: *id007
|
93
|
+
- !ruby/object:Gem::Dependency
|
128
94
|
name: multipart-post
|
129
|
-
requirement: !ruby/object:Gem::Requirement
|
95
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
130
96
|
none: false
|
131
|
-
requirements:
|
132
|
-
- -
|
133
|
-
- !ruby/object:Gem::Version
|
134
|
-
version:
|
97
|
+
requirements:
|
98
|
+
- - ">="
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: "0"
|
135
101
|
type: :runtime
|
136
102
|
prerelease: false
|
137
|
-
version_requirements:
|
138
|
-
|
139
|
-
|
140
|
-
- - ! '>='
|
141
|
-
- !ruby/object:Gem::Version
|
142
|
-
version: '0'
|
143
|
-
description: Rubix provides abstractions for connecting to Zabbix's API, an ORM for
|
144
|
-
wrapping Zabbix resources, a set of scripts for writing data to Zabbix, and a collection
|
145
|
-
of Monitor classes for building periodic monitors.
|
146
|
-
email:
|
103
|
+
version_requirements: *id008
|
104
|
+
description: Rubix provides abstractions for connecting to Zabbix's API, an ORM for wrapping Zabbix resources, a set of scripts for writing data to Zabbix, and a collection of Monitor classes for building periodic monitors.
|
105
|
+
email:
|
147
106
|
- dhruv@infochimps.com
|
148
107
|
- coders@infochimps.org
|
149
|
-
executables:
|
108
|
+
executables:
|
150
109
|
- zabbix_api
|
151
110
|
- zabbix_pipe
|
152
111
|
extensions: []
|
112
|
+
|
153
113
|
extra_rdoc_files: []
|
154
|
-
|
114
|
+
|
115
|
+
files:
|
155
116
|
- bin/zabbix_api
|
156
117
|
- bin/zabbix_pipe
|
157
118
|
- lib/rubix.rb
|
158
|
-
- lib/rubix/
|
159
|
-
- lib/rubix/
|
119
|
+
- lib/rubix/monitors/cluster_monitor.rb
|
120
|
+
- lib/rubix/monitors/zabbix_monitor.rb
|
121
|
+
- lib/rubix/monitors/monitor.rb
|
122
|
+
- lib/rubix/monitors/chef_monitor.rb
|
123
|
+
- lib/rubix/auto_sender.rb
|
124
|
+
- lib/rubix/associations.rb
|
125
|
+
- lib/rubix/associations/has_many_items.rb
|
126
|
+
- lib/rubix/associations/belongs_to_media_type.rb
|
127
|
+
- lib/rubix/associations/has_many_templates.rb
|
128
|
+
- lib/rubix/associations/belongs_to_action.rb
|
129
|
+
- lib/rubix/associations/has_many_conditions.rb
|
130
|
+
- lib/rubix/associations/has_many_user_groups.rb
|
131
|
+
- lib/rubix/associations/has_many_host_groups.rb
|
132
|
+
- lib/rubix/associations/has_many_user_macros.rb
|
133
|
+
- lib/rubix/associations/belongs_to_template.rb
|
134
|
+
- lib/rubix/associations/belongs_to_host.rb
|
135
|
+
- lib/rubix/associations/belongs_to_user.rb
|
136
|
+
- lib/rubix/associations/belongs_to_user_group.rb
|
137
|
+
- lib/rubix/associations/has_many_users.rb
|
138
|
+
- lib/rubix/associations/belongs_to_item.rb
|
139
|
+
- lib/rubix/associations/has_many_hosts.rb
|
140
|
+
- lib/rubix/associations/has_many_applications.rb
|
141
|
+
- lib/rubix/sender.rb
|
142
|
+
- lib/rubix/models/condition.rb
|
143
|
+
- lib/rubix/models/application.rb
|
160
144
|
- lib/rubix/models/media_type.rb
|
161
|
-
- lib/rubix/models/user_macro.rb
|
162
|
-
- lib/rubix/models/action.rb
|
163
|
-
- lib/rubix/models/script.rb
|
164
|
-
- lib/rubix/models/item.rb
|
165
|
-
- lib/rubix/models/user_group.rb
|
166
145
|
- lib/rubix/models/operation.rb
|
167
|
-
- lib/rubix/models/host.rb
|
168
|
-
- lib/rubix/models/host_group.rb
|
169
146
|
- lib/rubix/models/model.rb
|
170
|
-
- lib/rubix/models/
|
147
|
+
- lib/rubix/models/item.rb
|
171
148
|
- lib/rubix/models/time_series.rb
|
172
|
-
- lib/rubix/models/
|
173
|
-
- lib/rubix/models/
|
149
|
+
- lib/rubix/models/host.rb
|
150
|
+
- lib/rubix/models/medium.rb
|
151
|
+
- lib/rubix/models/action.rb
|
152
|
+
- lib/rubix/models/user_group.rb
|
153
|
+
- lib/rubix/models/template.rb
|
154
|
+
- lib/rubix/models/user_macro.rb
|
155
|
+
- lib/rubix/models/script.rb
|
156
|
+
- lib/rubix/models/host_group.rb
|
174
157
|
- lib/rubix/models/user.rb
|
158
|
+
- lib/rubix/models/trigger.rb
|
159
|
+
- lib/rubix/connection.rb
|
160
|
+
- lib/rubix/response.rb
|
161
|
+
- lib/rubix/monitors.rb
|
175
162
|
- lib/rubix/examples/simple_zabbix_monitor.rb
|
176
|
-
- lib/rubix/examples/simple_uptime_monitor.rb
|
177
163
|
- lib/rubix/examples/simple_cluster_monitor.rb
|
178
164
|
- lib/rubix/examples/simple_chef_monitor.rb
|
179
|
-
- lib/rubix/
|
180
|
-
- lib/rubix/sender.rb
|
165
|
+
- lib/rubix/examples/simple_uptime_monitor.rb
|
181
166
|
- lib/rubix/log.rb
|
182
167
|
- lib/rubix/models.rb
|
183
|
-
-
|
184
|
-
-
|
185
|
-
-
|
186
|
-
-
|
187
|
-
- lib/rubix/associations/belongs_to_media_type.rb
|
188
|
-
- lib/rubix/associations/belongs_to_template.rb
|
189
|
-
- lib/rubix/associations/has_many_host_groups.rb
|
190
|
-
- lib/rubix/associations/has_many_users.rb
|
191
|
-
- lib/rubix/associations/has_many_conditions.rb
|
192
|
-
- lib/rubix/associations/belongs_to_user.rb
|
193
|
-
- lib/rubix/associations/belongs_to_user_group.rb
|
194
|
-
- lib/rubix/associations/belongs_to_host.rb
|
195
|
-
- lib/rubix/associations/belongs_to_item.rb
|
196
|
-
- lib/rubix/associations/has_many_items.rb
|
197
|
-
- lib/rubix/associations/has_many_templates.rb
|
198
|
-
- lib/rubix/associations/belongs_to_action.rb
|
199
|
-
- lib/rubix/associations/has_many_user_groups.rb
|
200
|
-
- lib/rubix/associations/has_many_user_macros.rb
|
201
|
-
- lib/rubix/monitors/chef_monitor.rb
|
202
|
-
- lib/rubix/monitors/cluster_monitor.rb
|
203
|
-
- lib/rubix/monitors/zabbix_monitor.rb
|
204
|
-
- lib/rubix/monitors/monitor.rb
|
205
|
-
- lib/rubix/connection.rb
|
206
|
-
- lib/rubix/associations.rb
|
207
|
-
- spec/test.yml
|
168
|
+
- spec/data/test_template.xml
|
169
|
+
- spec/support/configliere_helper.rb
|
170
|
+
- spec/support/integration_helper.rb
|
171
|
+
- spec/support/response_helper.rb
|
208
172
|
- spec/rubix/model_spec.rb
|
209
|
-
- spec/rubix/
|
173
|
+
- spec/rubix/monitors/cluster_monitor_spec.rb
|
210
174
|
- spec/rubix/monitors/monitor_spec.rb
|
211
175
|
- spec/rubix/monitors/chef_monitor_spec.rb
|
212
176
|
- spec/rubix/monitors/zabbix_monitor_spec.rb
|
213
|
-
- spec/rubix/monitors/cluster_monitor_spec.rb
|
214
177
|
- spec/rubix/response_spec.rb
|
215
|
-
- spec/rubix/sender_spec.rb
|
216
178
|
- spec/rubix/connection_spec.rb
|
217
|
-
- spec/
|
218
|
-
- spec/
|
219
|
-
- spec/
|
220
|
-
- spec/requests/item_request_spec.rb
|
221
|
-
- spec/requests/action_request_spec.rb
|
179
|
+
- spec/rubix/auto_sender_spec.rb
|
180
|
+
- spec/rubix/sender_spec.rb
|
181
|
+
- spec/spec_helper.rb
|
222
182
|
- spec/requests/host_group_request_spec.rb
|
183
|
+
- spec/requests/user_request_spec.rb
|
184
|
+
- spec/requests/application_request_spec.rb
|
185
|
+
- spec/requests/action_request_spec.rb
|
186
|
+
- spec/requests/trigger_request_spec.rb
|
223
187
|
- spec/requests/user_macro_request_spec.rb
|
224
|
-
- spec/requests/connection_request_spec.rb
|
225
188
|
- spec/requests/template_request_spec.rb
|
226
|
-
- spec/requests/
|
227
|
-
- spec/requests/
|
228
|
-
- spec/requests/
|
189
|
+
- spec/requests/connection_request_spec.rb
|
190
|
+
- spec/requests/script_request_spec.rb
|
191
|
+
- spec/requests/item_request_spec.rb
|
229
192
|
- spec/requests/user_group_request_spec.rb
|
230
|
-
- spec/requests/
|
231
|
-
- spec/
|
232
|
-
- spec/
|
233
|
-
- spec/support/response_helper.rb
|
234
|
-
- spec/support/configliere_helper.rb
|
235
|
-
- spec/data/test_template.xml
|
193
|
+
- spec/requests/host_request_spec.rb
|
194
|
+
- spec/requests/media_type_request_spec.rb
|
195
|
+
- spec/requests/time_series_request_spec.rb
|
236
196
|
- LICENSE.md
|
237
197
|
- README.rdoc
|
238
198
|
- VERSION
|
@@ -240,35 +200,38 @@ files:
|
|
240
200
|
- Rakefile
|
241
201
|
- Gemfile
|
242
202
|
homepage: http://github.com/dhruvbansal/rubix
|
243
|
-
licenses:
|
203
|
+
licenses:
|
244
204
|
- Apache 2.0
|
245
205
|
post_install_message:
|
246
206
|
rdoc_options: []
|
247
|
-
|
207
|
+
|
208
|
+
require_paths:
|
248
209
|
- lib
|
249
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
210
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
250
211
|
none: false
|
251
|
-
requirements:
|
252
|
-
- -
|
253
|
-
- !ruby/object:Gem::Version
|
254
|
-
|
255
|
-
segments:
|
212
|
+
requirements:
|
213
|
+
- - ">="
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
hash: 4394641456942349771
|
216
|
+
segments:
|
256
217
|
- 0
|
257
|
-
|
258
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
218
|
+
version: "0"
|
219
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
259
220
|
none: false
|
260
|
-
requirements:
|
261
|
-
- -
|
262
|
-
- !ruby/object:Gem::Version
|
263
|
-
|
264
|
-
segments:
|
221
|
+
requirements:
|
222
|
+
- - ">="
|
223
|
+
- !ruby/object:Gem::Version
|
224
|
+
hash: 4394641456942349771
|
225
|
+
segments:
|
265
226
|
- 0
|
266
|
-
|
227
|
+
version: "0"
|
267
228
|
requirements: []
|
229
|
+
|
268
230
|
rubyforge_project:
|
269
|
-
rubygems_version: 1.8.
|
231
|
+
rubygems_version: 1.8.24
|
270
232
|
signing_key:
|
271
233
|
specification_version: 3
|
272
234
|
summary: A Ruby client for configuring and writing data to Zabbix
|
273
235
|
test_files: []
|
236
|
+
|
274
237
|
has_rdoc:
|