zbxapi 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/zbxapi.rb +11 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 88ef5fabf6b47c81073ee97d551d2dd6f7b7a40f
4
- data.tar.gz: 3633af6eae3cd25cf5aeca8b4aba490c39a6fb5c
3
+ metadata.gz: 61b077a5fa633e31fed897e4e786df74fabcfea7
4
+ data.tar.gz: 940ab012cdd8c72daf71edb5c4d2e38e0f05f1ae
5
5
  SHA512:
6
- metadata.gz: dcf4b2b1306f21755a4504e12fc1fadeebfc4333a5affda34e7b8cfd48fee1e63a741d50826b74836f573346b28b0f53c752c8611c1907d37f6d257d39a953f2
7
- data.tar.gz: eee2dbb07f1b22cb7063fd6a687514c66057c3a5bf411274e029d530fbe8afd5de18ce39029c186bea599817caac7c8a6634468cfcfae16f3341637e294190dc
6
+ metadata.gz: 96fc42cbb86e125aeb8d768e8920474a0f9d7521eb974f0519568e1a486dcc3258bc7004eed94adfac1cc6dcacf90207ea8e77a59aa9fde0d14f62568f2f19c8
7
+ data.tar.gz: 7f319d188968e1f084aa7ea79b7ce2693c788447e2e5fdd39dcf8db2d74b417b1b320d2d20243d83734a0947864a75f3a43e9b8945d8afe37332ebc1cdef272c
data/zbxapi.rb CHANGED
@@ -75,6 +75,7 @@ class ZabbixAPI
75
75
  @url=nil
76
76
  @verify_ssl=true
77
77
  @proxy_server=nil
78
+ @custom_headers=[]
78
79
 
79
80
  private
80
81
  @user_name=''
@@ -129,6 +130,10 @@ class ZabbixAPI
129
130
  @http_timeout=nil
130
131
  end
131
132
 
133
+ if options.has_key?:custom_headers
134
+ @custom_headers = options[:custom_headers];
135
+ end
136
+
132
137
  #Generate the list of sub objects dynamically, from all objects
133
138
  #derived from ZabbixAPI_Base
134
139
  objects=TRUE
@@ -392,8 +397,12 @@ class ZabbixAPI
392
397
  http=select_http_obj
393
398
  response = nil
394
399
  # http.set_debug_output($stderr) #Uncomment to see low level HTTP debug
395
- headers={'Content-Type'=>'application/json-rpc',
396
- 'User-Agent'=>'Zbx Ruby CLI'}
400
+
401
+ headers={
402
+ 'Content-Type'=>'application/json-rpc',
403
+ 'User-Agent'=>'Zbx Ruby CLI'
404
+ }.merge(@custom_headers)
405
+
397
406
  debug(4,:msg=>"Sending: #{json_obj}")
398
407
  response = http.post(@url.path, json_obj,headers)
399
408
  debug(4,:msg=>"Response Code: #{response.code}")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zbxapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - A. Nelson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-28 00:00:00.000000000 Z
11
+ date: 2014-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: json