zabbixapi 0.1.5a4 → 0.1.5a5

Sign up to get free protection for your applications and to get access to all the features.
@@ -41,14 +41,8 @@ module Zabbix
41
41
 
42
42
  unless ( response.empty? ) then
43
43
  result = []
44
- if response.kind_of? Hash
45
- response.each_key() do |template_id|
46
- result << template_id
47
- end
48
- elsif response.kind_of? Array
49
- response.each do |template_info|
50
- result << template_info['templateid']
51
- end
44
+ response.each_key() do |template_id|
45
+ result << template_id
52
46
  end
53
47
  else
54
48
  result = nil
@@ -129,8 +123,8 @@ module Zabbix
129
123
  message = {
130
124
  'method' => 'template.massAdd',
131
125
  'params' => {
132
- 'hosts' => message_hosts_id,
133
- 'templates' => message_templates_id
126
+ 'hosts' => message_hosts_id.map{|t| {"hostid" => t}},
127
+ 'templates' => message_templates_id.map{|t| {"templateid" => t}}
134
128
  }
135
129
  }
136
130
 
@@ -156,8 +150,8 @@ module Zabbix
156
150
  message = {
157
151
  'method' => 'template.massRemove',
158
152
  'params' => {
159
- 'hosts' => message_hosts_id,
160
- 'templates' => message_templates_id,
153
+ 'hostids' => message_hosts_id,
154
+ 'templateids' => message_templates_id,
161
155
  'force' => '1'
162
156
  }
163
157
  }
data/zabbixapi.gemspec CHANGED
@@ -4,13 +4,13 @@ require 'rake'
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
 
7
- spec.version = '0.1.5a4'
7
+ spec.version = '0.1.5a5'
8
8
  spec.name = 'zabbixapi'
9
9
  spec.summary = 'Ruby module for work with zabbix api.'
10
10
 
11
- spec.email = 'verm666@gmail.com'
12
- spec.author = 'Eduard Snesarev'
13
- spec.homepage = 'http://github.com/verm666/RubyZabbixApi'
11
+ spec.email = 'vadv.mkn@gmail.com'
12
+ spec.author = 'Vasiliev Dmitry'
13
+ spec.homepage = 'https://github.com/vadv/zabbixapi/wiki'
14
14
  spec.description = 'Ruby module for work with zabbix api. '
15
15
 
16
16
  spec.has_rdoc = true
metadata CHANGED
@@ -1,18 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbixapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5a4
4
+ version: 0.1.5a5
5
5
  prerelease: 5
6
6
  platform: ruby
7
7
  authors:
8
- - Eduard Snesarev
8
+ - Vasiliev Dmitry
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-27 00:00:00.000000000Z
12
+ date: 2012-10-04 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: ! 'Ruby module for work with zabbix api. '
15
- email: verm666@gmail.com
15
+ email: vadv.mkn@gmail.com
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files:
@@ -39,7 +39,7 @@ files:
39
39
  - examples/zabbix_la
40
40
  - examples/zabbix_memory
41
41
  - examples/zabbix_net
42
- homepage: http://github.com/verm666/RubyZabbixApi
42
+ homepage: https://github.com/vadv/zabbixapi/wiki
43
43
  licenses: []
44
44
  post_install_message:
45
45
  rdoc_options: []