zabbix_sender_api 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c9123c68e858ea0ee8e481034932ed7f65d0d79bdaffa5cd4184b6aabb6b244c
4
- data.tar.gz: 5be57097f6cf6b07ad00228b45646503ab0e330cecafc09406e3946835234bcd
3
+ metadata.gz: d16ac5d439463565af4464d544a3727b3db203f327f884db6ee4e1e0e6c3cf43
4
+ data.tar.gz: dc9a90da9cccafe560d8b5c2ced56eace9190ae0b1bf846bd4a28d3c8ba855c1
5
5
  SHA512:
6
- metadata.gz: ccdd494c7326f82150dfce5f7296bcc51b8e337b43349339482ed5eadd8ddd1fc4bddafd3ff11b2fab369730c68b573efbceb2a53b8eb31fd58c871726e2a2d5
7
- data.tar.gz: d4aa26a9b716fe8231f2a8d6bb4b457c6fc32100c8c1dc5f7c5095a3f03c5bb48f000568b90fb64c2d0cda1792f66f295708fb7dd99282c370d08cc4b94a9166
6
+ metadata.gz: 332b01b2058bbeeffe89dab63db3293202770d51c96f45dca4453d386640eae9b88bf81849b6165c0ff79c77db1ba167568f6d3b6f9ee5c3c3d2871e4bde69d6
7
+ data.tar.gz: ae0e30678c6009254bf66704b5b9f817afe41c8d9c9cc1378ad1eae577af53c717c72d3802bfa14a88b684d818d8090b7d4017e38afaf42ea518887f4d6977c5
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- zabbix_sender_api (0.1.0)
4
+ zabbix_sender_api (1.0.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
data/README.md CHANGED
@@ -4,6 +4,8 @@ This gem describes an api that takes some of the drudgery out of the task of put
4
4
 
5
5
  **Detailed documentation for this library is at [rubydoc.info](https://rubydoc.info/gems/zabbix_sender_api)**
6
6
 
7
+ Look at [the source for the zfstozab gem](https://gitlab.com/svdasein/zfstozab/-/blob/master/exe/zabbix-zfs.rb) for a practical example how to use this api.
8
+
7
9
  zabbix_sender is a command line utility for sending monitoring data to Zabbix server or proxy. On the Zabbix server an item of type Zabbix trapper should be created with corresponding key.
8
10
 
9
11
  * [Zabbix sender manpage](https://www.zabbix.com/documentation/4.0/manpages/zabbix_sender)
@@ -60,6 +60,7 @@ class AgentConfiguration
60
60
  end
61
61
 
62
62
  module Sender
63
+ require 'set'
63
64
 
64
65
  ##
65
66
  # Pipe instances encapsulate communication to a running instance of zabbix_sender
@@ -172,12 +173,13 @@ end
172
173
  # then pass the discover instance into a Batch via addDiscovery(), which
173
174
  # includes it in the batch of data just like an ordinary ItemData instance.
174
175
  class Discovery < ItemData
176
+ attr_reader :entities
175
177
  ##
176
178
  # The only required parameter is key:, which is the discovery rule key.
177
179
  #
178
180
  def initialize(key: nil,value: nil, timestamp: nil, hostname: nil)
179
181
  super
180
- @entities = Array.new
182
+ @entities = Set.new
181
183
  end
182
184
  ##
183
185
  # This is how you pass data to zabbix that you use to construct items from item templates. Pass in
@@ -193,7 +195,7 @@ class Discovery < ItemData
193
195
  aHash.each_pair { |key,value|
194
196
  zabbified[%Q({##{key.to_s.upcase}})] = value
195
197
  }
196
- @entities.push(zabbified)
198
+ @entities.add(zabbified)
197
199
  end
198
200
  ##
199
201
  # Render this discovery instance as a zabbix_sender line.
@@ -1,3 +1,3 @@
1
1
  module ZabbixSenderApi
2
- VERSION = "1.0.3"
2
+ VERSION = "1.0.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zabbix_sender_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dave Parker
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-02 00:00:00.000000000 Z
11
+ date: 2020-08-04 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: This gem describes an api to the zabbix sender facility. It saves tons
14
14
  of hassle when you're cranking out custom polling logic
@@ -58,7 +58,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
58
58
  - !ruby/object:Gem::Version
59
59
  version: '0'
60
60
  requirements: []
61
- rubygems_version: 3.1.2
61
+ rubygems_version: 3.1.4
62
62
  signing_key:
63
63
  specification_version: 4
64
64
  summary: Ruby frontend to the zabbix_sender command line tool