zabbixapi 0.5.6 → 0.5.7

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.
@@ -23,7 +23,7 @@ class ZabbixApi
23
23
  case @client.api_version
24
24
  when "1.3", "1.2"
25
25
  apidir = "1.8"
26
- when "2.0.4"
26
+ when "1.4", "2.0.4"
27
27
  apidir = "2.0"
28
28
  else
29
29
  raise "unknown Api version!"
@@ -64,6 +64,13 @@ class ZabbixApi
64
64
  width = data[:width] || 200 # default 200
65
65
  vsize = data[:vsize] || (graphids.size/hsize).to_i
66
66
  screenid = get_id(:name => screen_name)
67
+
68
+ if ((graphids.size/hsize) / 2) == 0
69
+ vsize = data[:vsize] || (graphids.size/hsize).to_i
70
+ else
71
+ vsize = data[:vsize] || ((graphids.size/hsize)+1).to_i
72
+ end
73
+
67
74
  unless screenid
68
75
  # Create screen
69
76
  graphids.each_with_index do |graphid, index|
@@ -64,6 +64,13 @@ class ZabbixApi
64
64
  width = data[:width] || 200 # default 200
65
65
  vsize = data[:vsize] || (graphids.size/hsize).to_i
66
66
  screenid = get_id(:name => screen_name)
67
+
68
+ if ((graphids.size/hsize) / 2) == 0
69
+ vsize = data[:vsize] || (graphids.size/hsize).to_i
70
+ else
71
+ vsize = data[:vsize] || ((graphids.size/hsize)+1).to_i
72
+ end
73
+
67
74
  unless screenid
68
75
  # Create screen
69
76
  graphids.each_with_index do |graphid, index|
@@ -49,7 +49,7 @@ class ZabbixApi
49
49
  def http_request(body)
50
50
  uri = URI.parse(@options[:url])
51
51
 
52
- if @proxy_uri.nil?
52
+ unless @proxy_uri.nil?
53
53
  http = Net::HTTP.Proxy(@proxy_host, @proxy_port, @proxy_user, @proxy_pass).new(uri.host, uri.port)
54
54
  if uri.port == 443
55
55
  http.use_ssl = true
@@ -1,3 +1,3 @@
1
1
  class ZabbixApi
2
- VERSION = "0.5.6"
2
+ VERSION = "0.5.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbixapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.6
4
+ version: 0.5.7
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-02-03 00:00:00.000000000 Z
12
+ date: 2013-03-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -111,3 +111,4 @@ summary: Realization for Zabbix API.
111
111
  test_files:
112
112
  - spec/localhost.rb
113
113
  - spec/run.rb
114
+ has_rdoc: