zabbix_sender_api 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  Module: ZabbixSenderApi
8
8
 
9
- &mdash; Documentation by YARD 0.9.26
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -107,7 +107,7 @@
107
107
  <dt id="VERSION-constant" class="">VERSION =
108
108
 
109
109
  </dt>
110
- <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.1.2</span><span class='tstring_end'>&quot;</span></span></pre></dd>
110
+ <dd><pre class="code"><span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>1.1.4</span><span class='tstring_end'>&quot;</span></span></pre></dd>
111
111
 
112
112
  </dl>
113
113
 
@@ -123,9 +123,9 @@
123
123
  </div>
124
124
 
125
125
  <div id="footer">
126
- Generated on Sat Sep 18 21:55:40 2021 by
127
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128
- 0.9.26 (ruby-2.7.4).
126
+ Generated on Fri Jan 3 16:13:55 2025 by
127
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
128
+ 0.9.36 (ruby-3.2.2).
129
129
  </div>
130
130
 
131
131
  </div>
data/public/_index.html CHANGED
@@ -4,7 +4,7 @@
4
4
  <meta charset="utf-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
6
  <title>
7
- Documentation by YARD 0.9.26
7
+ Documentation by YARD 0.9.36
8
8
 
9
9
  </title>
10
10
 
@@ -52,7 +52,7 @@
52
52
  <div class="clear"></div>
53
53
  </div>
54
54
 
55
- <div id="content"><h1 class="noborder title">Documentation by YARD 0.9.26</h1>
55
+ <div id="content"><h1 class="noborder title">Documentation by YARD 0.9.36</h1>
56
56
  <div id="listing">
57
57
  <h1 class="alphaindex">Alphabetic Index</h1>
58
58
 
@@ -172,12 +172,12 @@
172
172
  </ul>
173
173
 
174
174
 
175
- <ul id="alpha_P" class="alpha">
176
- <li class="letter">P</li>
175
+ <ul id="alpha_N" class="alpha">
176
+ <li class="letter">N</li>
177
177
  <ul>
178
178
 
179
179
  <li>
180
- <span class='object_link'><a href="Zabbix/Sender/Pipe.html" title="Zabbix::Sender::Pipe (class)">Pipe</a></span>
180
+ <span class='object_link'><a href="Zabbix/Sender/NanosecondItemData.html" title="Zabbix::Sender::NanosecondItemData (class)">NanosecondItemData</a></span>
181
181
 
182
182
  <small>(Zabbix::Sender)</small>
183
183
 
@@ -190,6 +190,21 @@
190
190
  </td><td valign='top' width="33%">
191
191
 
192
192
 
193
+ <ul id="alpha_P" class="alpha">
194
+ <li class="letter">P</li>
195
+ <ul>
196
+
197
+ <li>
198
+ <span class='object_link'><a href="Zabbix/Sender/Pipe.html" title="Zabbix::Sender::Pipe (class)">Pipe</a></span>
199
+
200
+ <small>(Zabbix::Sender)</small>
201
+
202
+ </li>
203
+
204
+ </ul>
205
+ </ul>
206
+
207
+
193
208
  <ul id="alpha_S" class="alpha">
194
209
  <li class="letter">S</li>
195
210
  <ul>
@@ -238,9 +253,9 @@
238
253
  </div>
239
254
 
240
255
  <div id="footer">
241
- Generated on Sat Sep 18 21:55:40 2021 by
242
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
243
- 0.9.26 (ruby-2.7.4).
256
+ Generated on Fri Jan 3 16:13:55 2025 by
257
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
258
+ 0.9.36 (ruby-3.2.2).
244
259
  </div>
245
260
 
246
261
  </div>
@@ -43,7 +43,7 @@
43
43
 
44
44
  <ul id="full_list" class="class">
45
45
  <li id="object_" class="odd"><div class="item" style="padding-left:30px"><span class='object_link'><a href="top-level-namespace.html" title="Top Level Namespace (root)">Top Level Namespace</a></span></div></li>
46
- <li id='object_Zabbix' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="Zabbix.html" title="Zabbix (module)">Zabbix</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_Zabbix::AgentConfiguration' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Zabbix/AgentConfiguration.html" title="Zabbix::AgentConfiguration (class)">AgentConfiguration</a></span> &lt; Object<small class='search_info'>Zabbix</small></div></li><li id='object_Zabbix::Sender' class='collapsed even'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="Zabbix/Sender.html" title="Zabbix::Sender (module)">Sender</a></span><small class='search_info'>Zabbix</small></div><ul><li id='object_Zabbix::Sender::Batch' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Batch.html" title="Zabbix::Sender::Batch (class)">Batch</a></span> &lt; Object<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::Connection' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Connection.html" title="Zabbix::Sender::Connection (class)">Connection</a></span> &lt; Object<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::Discovery' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Discovery.html" title="Zabbix::Sender::Discovery (class)">Discovery</a></span> &lt; ItemData<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::ItemData' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/ItemData.html" title="Zabbix::Sender::ItemData (class)">ItemData</a></span> &lt; Object<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::Pipe' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Pipe.html" title="Zabbix::Sender::Pipe (class)">Pipe</a></span> &lt; Connection<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::Socket' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Socket.html" title="Zabbix::Sender::Socket (class)">Socket</a></span> &lt; Connection<small class='search_info'>Zabbix::Sender</small></div></li></ul></li></ul></li><li id='object_ZabbixSenderApi' class='odd'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="ZabbixSenderApi.html" title="ZabbixSenderApi (module)">ZabbixSenderApi</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_ZabbixSenderApi::Error' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="ZabbixSenderApi/Error.html" title="ZabbixSenderApi::Error (class)">Error</a></span> &lt; StandardError<small class='search_info'>ZabbixSenderApi</small></div></li></ul></li>
46
+ <li id='object_Zabbix' class='even'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="Zabbix.html" title="Zabbix (module)">Zabbix</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_Zabbix::AgentConfiguration' class='collapsed odd'><div class='item' style='padding-left:45px'><span class='object_link'><a href="Zabbix/AgentConfiguration.html" title="Zabbix::AgentConfiguration (class)">AgentConfiguration</a></span> &lt; Object<small class='search_info'>Zabbix</small></div></li><li id='object_Zabbix::Sender' class='collapsed even'><div class='item' style='padding-left:45px'><a class='toggle'></a> <span class='object_link'><a href="Zabbix/Sender.html" title="Zabbix::Sender (module)">Sender</a></span><small class='search_info'>Zabbix</small></div><ul><li id='object_Zabbix::Sender::Batch' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Batch.html" title="Zabbix::Sender::Batch (class)">Batch</a></span> &lt; Object<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::Connection' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Connection.html" title="Zabbix::Sender::Connection (class)">Connection</a></span> &lt; Object<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::Discovery' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Discovery.html" title="Zabbix::Sender::Discovery (class)">Discovery</a></span> &lt; ItemData<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::ItemData' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/ItemData.html" title="Zabbix::Sender::ItemData (class)">ItemData</a></span> &lt; Object<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::NanosecondItemData' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/NanosecondItemData.html" title="Zabbix::Sender::NanosecondItemData (class)">NanosecondItemData</a></span> &lt; ItemData<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::Pipe' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Pipe.html" title="Zabbix::Sender::Pipe (class)">Pipe</a></span> &lt; Connection<small class='search_info'>Zabbix::Sender</small></div></li><li id='object_Zabbix::Sender::Socket' class='collapsed'><div class='item' style='padding-left:60px'><span class='object_link'><a href="Zabbix/Sender/Socket.html" title="Zabbix::Sender::Socket (class)">Socket</a></span> &lt; Connection<small class='search_info'>Zabbix::Sender</small></div></li></ul></li></ul></li><li id='object_ZabbixSenderApi' class='odd'><div class='item' style='padding-left:30px'><a class='toggle'></a> <span class='object_link'><a href="ZabbixSenderApi.html" title="ZabbixSenderApi (module)">ZabbixSenderApi</a></span><small class='search_info'>Top Level Namespace</small></div><ul><li id='object_ZabbixSenderApi::Error' class='collapsed even'><div class='item' style='padding-left:45px'><span class='object_link'><a href="ZabbixSenderApi/Error.html" title="ZabbixSenderApi::Error (class)">Error</a></span> &lt; StandardError<small class='search_info'>ZabbixSenderApi</small></div></li></ul></li>
47
47
 
48
48
  </ul>
49
49
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: CHANGELOG
8
8
 
9
- &mdash; Documentation by YARD 0.9.26
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -57,31 +57,25 @@
57
57
  <div class="clear"></div>
58
58
  </div>
59
59
 
60
- <div id="content"><div id='filecontents'>
61
- <h1 id="label-1.1.0">1.1.0</h1>
62
- <ul><li>
63
- <p>added native (socket based) sender logic (Zabbix::Sender::Socket).</p>
64
- </li><li>
65
- <p>changed Zabbix::Sender::Pipe&#39;s open method from popen to Open3::popen3 to allow capture of stdout stderf and exitA</p>
66
- </li><li>
67
- <p>the Socket and Pipe .flush method returns status, sendBatchAtomic relays it from its internal call to flush</p>
68
-
69
- <h1 id="label-1.1.1">1.1.1</h1>
70
- </li><li>
71
- <p>added ability to override Zabbix::AgentConfiguration search path</p>
72
- </li><li>
73
- <p>cleaned up a few issues + the docs</p>
74
-
75
- <h1 id="label-1.1.2">1.1.2</h1>
76
- </li><li>
77
- <p>This is just a documentation fix. rubydoc.info wasn&#39;t generating docs from the gem properly so docs are now in a gitlab “pages” site.</p>
78
- </li></ul>
60
+ <div id="content"><div id='filecontents'><h1 id="section">1.1.0</h1>
61
+ <ul>
62
+ <li>added native (socket based) sender logic (Zabbix::Sender::Socket).</li>
63
+ <li>changed Zabbix::Sender::Pipe’s open method from popen to Open3::popen3 to allow capture of stdout stderf and exitA</li>
64
+ <li>the Socket and Pipe .flush method returns status, sendBatchAtomic relays it from its internal call to flush
65
+ # 1.1.1</li>
66
+ <li>added ability to override Zabbix::AgentConfiguration search path</li>
67
+ <li>cleaned up a few issues + the docs
68
+ # 1.1.2</li>
69
+ <li>This is just a documentation fix. rubydoc.info wasn’t generating docs from the gem properly so docs are now in a gitlab “pages” site.
70
+ # 1.1.3</li>
71
+ <li>BUG fix for Discovery when using Socket mode.</li>
72
+ </ul>
79
73
  </div></div>
80
74
 
81
75
  <div id="footer">
82
- Generated on Sat Sep 18 21:55:40 2021 by
83
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
84
- 0.9.26 (ruby-2.7.4).
76
+ Generated on Fri Jan 3 16:13:55 2025 by
77
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
78
+ 0.9.36 (ruby-3.2.2).
85
79
  </div>
86
80
 
87
81
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: LICENSE
8
8
 
9
- &mdash; Documentation by YARD 0.9.26
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -60,9 +60,9 @@
60
60
  <div id="content"><div id='filecontents'>The MIT License (MIT)<br/><br/>Copyright (c) 2020 Dave Parker<br/><br/>Permission is hereby granted, free of charge, to any person obtaining a copy<br/>of this software and associated documentation files (the &quot;Software&quot;), to deal<br/>in the Software without restriction, including without limitation the rights<br/>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>copies of the Software, and to permit persons to whom the Software is<br/>furnished to do so, subject to the following conditions:<br/><br/>The above copyright notice and this permission notice shall be included in<br/>all copies or substantial portions of the Software.<br/><br/>THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br/>THE SOFTWARE.</div></div>
61
61
 
62
62
  <div id="footer">
63
- Generated on Sat Sep 18 21:55:40 2021 by
64
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
65
- 0.9.26 (ruby-2.7.4).
63
+ Generated on Fri Jan 3 16:13:55 2025 by
64
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
65
+ 0.9.36 (ruby-3.2.2).
66
66
  </div>
67
67
 
68
68
  </div>
@@ -6,7 +6,7 @@
6
6
  <title>
7
7
  File: README
8
8
 
9
- &mdash; Documentation by YARD 0.9.26
9
+ &mdash; Documentation by YARD 0.9.36
10
10
 
11
11
  </title>
12
12
 
@@ -57,125 +57,135 @@
57
57
  <div class="clear"></div>
58
58
  </div>
59
59
 
60
- <div id="content"><div id='filecontents'>
61
- <h1 id="label-zabbix_sender_api+rdoc-image-3Ahttps-3A-2F-2Fbadge.fury.io-2Frb-2Fzabbix_sender_api.svg">zabbix_sender_api <a href="https://badge.fury.io/rb/zabbix_sender_api"><img src="https://badge.fury.io/rb/zabbix_sender_api.svg"></a></h1>
60
+ <div id="content"><div id='filecontents'><h1 id="zabbixsenderapi-gem-versionhttpsbadgefuryiorbzabbixsenderapisvghttpsbadgefuryiorbzabbixsenderapi">zabbix_sender_api <a href="https://badge.fury.io/rb/zabbix_sender_api"><img src="https://badge.fury.io/rb/zabbix_sender_api.svg" alt="Gem Version" /></a></h1>
62
61
 
63
- <p>This gem provides a model for assembling and sending data to Zabbix via its sender/trapper mechanism. It works both with the zabbix_sender command line utility, or by itself using a socket connection to a trapper port direct from Ruby.</p>
62
+ <p>This gem provides a model for assembling and sending data to Zabbix via its sender/trapper mechanism. It works both with the zabbix_sender command line utility, or by itself using a socket connection to a trapper port direct from Ruby.</p>
64
63
 
65
- <p><strong>Detailed documentation for this library is <a href="https://svdasein.gitlab.io/zabbix_sender_api">>>HERE<<</a></strong></p>
64
+ <p><strong>Detailed documentation for this library is <a href="https://svdasein.gitlab.io/zabbix_sender_api"HERE«</a></strong></p>
66
65
 
67
- <p><strong>Source repository is <a href="https://gitlab.com/svdasein/zabbix_sender_api">>>HERE<<</a></strong></p>
66
+ <p><strong>Source repository is <a href="https://gitlab.com/svdasein/zabbix_sender_api"HERE«</a></strong></p>
68
67
 
69
68
  <p>Look at <a href="https://gitlab.com/svdasein/zfstozab/-/blob/master/exe/zabbix-zfs.rb">the source for the zfstozab gem</a> for a practical example how to use this api.</p>
70
69
 
71
70
  <p>zabbix_sender_api can send data to zabbix via one of two included connection types:</p>
72
- <ul><li>
73
- <p>zabbix_sender (this was the original and for quite some time only mode supported)</p>
74
- </li><li>
75
- <p>TCP socket connection directly to a Zabbix “trapper” port (as of vers 1.1.0)</p>
76
- </li></ul>
71
+
72
+ <ul>
73
+ <li>zabbix_sender (this was the original and for quite some time only mode supported)</li>
74
+ <li>TCP socket connection directly to a Zabbix “trapper” port (as of vers 1.1.0)</li>
75
+ </ul>
77
76
 
78
77
  <p>If you need to interact with the Zabbix REST API, you might also be interested in <a href="https://svdasein.gitlab.io/zabbix-api/">zabbix-api-simple</a></p>
79
78
 
80
- <h2 id="label-Installation">Installation</h2>
79
+ <h2 id="installation">Installation</h2>
81
80
 
82
81
  <pre class="code ruby"><code class="ruby">$ gem install zabbix_sender_api
83
82
  </code></pre>
84
83
 
85
- <h2 id="label-Usage">Usage</h2>
86
-
87
- <h3 id="label-Synopsis">Synopsis</h3>
84
+ <h2 id="usage">Usage</h2>
88
85
 
89
- <pre class="code ruby"><code class="ruby"><span class='comment'>#!/usr/bin/env ruby
90
- </span><span class='id identifier rubyid_require'>require</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>zabbix_sender_api</span><span class='tstring_end'>&#39;</span></span>
86
+ <h3 id="synopsis">Synopsis</h3>
87
+ <p>```ruby
88
+ #!/usr/bin/env ruby
89
+ require ‘zabbix_sender_api’</p>
91
90
 
92
- <span class='id identifier rubyid_sender'>sender</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Zabbix.html" title="Zabbix (module)">Zabbix</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Zabbix/Sender.html" title="Zabbix::Sender (module)">Sender</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Zabbix/Sender/Pipe.html" title="Zabbix::Sender::Pipe (class)">Pipe</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Zabbix/Sender/Pipe.html#initialize-instance_method" title="Zabbix::Sender::Pipe#initialize (method)">new</a></span></span>
91
+ <p>sender = Zabbix::Sender::Pipe.new</p>
93
92
 
94
- <span class='id identifier rubyid_rawdata'>rawdata</span> <span class='op'>=</span> <span class='lbrace'>{</span> <span class='symbol'>:myFirstKey</span> <span class='op'>=&gt;</span> <span class='int'>0</span><span class='comma'>,</span> <span class='symbol'>:mySecondKey</span> <span class='op'>=&gt;</span> <span class='int'>100</span> <span class='rbrace'>}</span>
93
+ <p>rawdata = { :myFirstKey =&gt; 0, :mySecondKey =&gt; 100 }</p>
95
94
 
96
- <span class='id identifier rubyid_data'>data</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Zabbix.html" title="Zabbix (module)">Zabbix</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Zabbix/Sender.html" title="Zabbix::Sender (module)">Sender</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Zabbix/Sender/Batch.html" title="Zabbix::Sender::Batch (class)">Batch</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Zabbix/Sender/Batch.html#initialize-instance_method" title="Zabbix::Sender::Batch#initialize (method)">new</a></span></span>
95
+ <p>data = Zabbix::Sender::Batch.new</p>
97
96
 
98
- <span class='id identifier rubyid_rawdata'>rawdata</span><span class='period'>.</span><span class='id identifier rubyid_each_pair'>each_pair</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_key'>key</span><span class='comma'>,</span><span class='id identifier rubyid_value'>value</span><span class='op'>|</span>
99
- <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_addItemData'>addItemData</span><span class='lparen'>(</span><span class='label'>key:</span> <span class='id identifier rubyid_key'>key</span><span class='comma'>,</span><span class='label'>value:</span> <span class='id identifier rubyid_value'>value</span><span class='rparen'>)</span>
100
- <span class='rbrace'>}</span>
97
+ <p>rawdata.each_pair {|key,value|
98
+ data.addItemData(key: key,value: value)
99
+ }</p>
101
100
 
102
- <span class='id identifier rubyid_sender'>sender</span><span class='period'>.</span><span class='id identifier rubyid_sendBatchAtomic'>sendBatchAtomic</span><span class='lparen'>(</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
103
- </code></pre>
101
+ <p>sender.sendBatchAtomic(data)
102
+ ```</p>
104
103
 
105
104
  <p>The above will execute zabbix_sender for you and send data into it as described above.</p>
106
105
 
107
106
  <p>Alternatively you can just</p>
108
107
 
109
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_to_senderline'>to_senderline</span>
110
- </code></pre>
111
-
112
- <p>… and do whatever you want w/ the stdout</p>
108
+ <p><code>ruby
109
+ puts data.to_senderline
110
+ </code>
111
+ and do whatever you want w/ the stdout</p>
113
112
 
114
113
  <p>To do low level discovery:</p>
115
114
 
116
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_disco'>disco</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Zabbix.html" title="Zabbix (module)">Zabbix</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Zabbix/Sender.html" title="Zabbix::Sender (module)">Sender</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Zabbix/Sender/Discovery.html" title="Zabbix::Sender::Discovery (class)">Discovery</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Zabbix/Sender/Discovery.html#initialize-instance_method" title="Zabbix::Sender::Discovery#initialize (method)">new</a></span></span><span class='lparen'>(</span><span class='label'>key:</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>discoveryRuleKey</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
115
+ <p>```ruby
116
+ disco = Zabbix::Sender::Discovery.new(key: ‘discoveryRuleKey’)</p>
117
117
 
118
- <span class='id identifier rubyid_disco'>disco</span><span class='period'>.</span><span class='id identifier rubyid_add_entity'>add_entity</span><span class='lparen'>(</span><span class='symbol'>:SOMEUSEFULVALUE</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>aValue</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='symbol'>:ANOTHERONE</span> <span class='op'>=&gt;</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>somethingElse</span><span class='tstring_end'>&#39;</span></span><span class='rparen'>)</span>
118
+ <p>disco.add_entity(:SOMEUSEFULVALUE =&gt; aValue’, :ANOTHERONE =&gt; somethingElse)</p>
119
119
 
120
- <span class='id identifier rubyid_data'>data</span><span class='period'>.</span><span class='id identifier rubyid_addDiscovery'>addDiscovery</span><span class='lparen'>(</span><span class='id identifier rubyid_disco'>disco</span><span class='rparen'>)</span>
121
- </code></pre>
120
+ <p>data.addDiscovery(disco)</p>
122
121
 
123
- <h3 id="label-Under+the+hood">Under the hood</h3>
122
+ <p>```</p>
124
123
 
125
- <h4 id="label-Zabbix-3A-3ASender-3A-3APipe+method-3A">Zabbix::Sender::Pipe method:</h4>
124
+ <h3 id="under-the-hood">Under the hood</h3>
126
125
 
126
+ <h4 id="zabbixsenderpipe-method">Zabbix::Sender::Pipe method:</h4>
127
127
  <p>The zabbix-sender cli utility provides a number of methods by which to insert data into zabbix.</p>
128
- <ul><li>
129
- <p>zabbix-sender … -s zabbixHostName -k keyName -o value (one k-v pair at a time)</p>
130
- </li><li>
131
- <p>zabbix-sender … -i - (series of kv pairs from stdin using zabbix-sender start time as timestamp)</p>
132
- </li><li>
133
- <p>zabbix-sender … -T -i - (series of kv pairs with their own embedded timestamps from stdin)</p>
134
- </li></ul>
135
128
 
136
- <p>In the latter two cases, the zabbix host name (the name of the host that zabbix is monitoring) is embedded in the stdin data.</p>
129
+ <ul>
130
+ <li>zabbix-sender … -s zabbixHostName -k keyName -o value (one k-v pair at a time)</li>
131
+ <li>zabbix-sender … -i - (series of kv pairs from stdin using zabbix-sender start time as timestamp)</li>
132
+ <li>zabbix-sender … -T -i - (series of kv pairs with their own embedded timestamps from stdin)</li>
133
+ </ul>
137
134
 
138
- <p>In all cases it is presumed that the zabbix server or proxy to which data should be sent is specified. This can be done either by specifying it explicitly with the -z switch, or indirectly by pointing it to a zabbix sender configuration file with the -c switch. If you let zabbix_sender_api handle executing zabbix_sender, the target will be specified on the command line via the -z switch.</p>
135
+ <p>In the latter two cases, the zabbix host name (the name of the host that zabbix is monitoring) is embedded
136
+ in the stdin data.</p>
137
+
138
+ <p>In all cases it is presumed that the zabbix server or proxy to which data should be sent is specified. This can
139
+ be done either by specifying it explicitly with the -z switch, or indirectly by pointing it to a zabbix sender configuration
140
+ file with the -c switch. If you let zabbix_sender_api handle executing zabbix_sender, the target will be specified on the
141
+ command line via the -z switch.</p>
139
142
 
140
143
  <p>zabbix_sender_api utilizes the -T -i - form, so the generated data lines look like this:</p>
141
144
 
142
- <pre class="code ruby"><code class="ruby">&quot;theHostBeingMonitored&quot; myFirstKey 1551719379 0
143
- &quot;theHostBeingMonitored&quot; mySecondKey 1551719379 100
144
- </code></pre>
145
+ <p><code>
146
+ "theHostBeingMonitored" myFirstKey 1551719379 0
147
+ "theHostBeingMonitored" mySecondKey 1551719379 100
148
+ </code></p>
145
149
 
146
- <p>The above lines will send data to two items associated with the host theHostBeingMonitored: myFirstKey gets the value 0, and mySecondKey gets the value 100. In both cases the time stamp is identical but it need not be (see the exe/example.rb for specifics).</p>
150
+ <p>The above lines will send data to two items associated with the host theHostBeingMonitored: myFirstKey gets the value 0, and mySecondKey gets the value 100. In both cases the
151
+ time stamp is identical but it need not be (see the exe/example.rb for specifics).</p>
147
152
 
148
153
  <p>Low level discovery (LLD) is also possible with zabbix-sender; the format of the stdin data is not so pretty but zabbix_sender_api handles all that:</p>
149
154
 
150
- <pre class="code ruby"><code class="ruby">&quot;theHostBeingMonitored&quot; discoveryRuleKey 1551719797 {&quot;data&quot;:[{&quot;{#SOMEUSEFULVALUE}&quot;:&quot;aValue&quot;,&quot;{#ANOTHERONE}&quot;:&quot;somethingElse&quot;}]}
151
- </code></pre>
152
-
153
- <p>The above line sends an LLD discovery structure (formatted as json) to the <a href="https://www.zabbix.com/documentation/4.0/manual/discovery/low_level_discovery#discovery_rule">discovery rule</a> whose key is discoveryRuleKey. It describes one entity by passing the macro values <a href="https://www.zabbix.com/documentation/4.0/manual/config/macros/lld_macros">#SOMEUSEFULVALUE} and #ANOTHERONE to the discovery rule. These ‘{lld macros</a>&#39; are available for use in item,trigger, and graph prototypes.</p>
154
-
155
- <p>If you wished to use the above lld to actually do some discovery, you&#39;d set things up in zabbix roughly like this:</p>
155
+ <p><code>
156
+ "theHostBeingMonitored" discoveryRuleKey 1551719797 {"data":[{"{#SOMEUSEFULVALUE}":"aValue","{#ANOTHERONE}":"somethingElse"}]}
157
+ </code>
158
+ The above line sends an LLD discovery structure (formatted as json) to the <a href="https://www.zabbix.com/documentation/4.0/manual/discovery/low_level_discovery#discovery_rule">discovery rule</a> whose key is discoveryRuleKey. It describes one entity by passing the macro values
159
+ #SOMEUSEFULVALUE and #ANOTHERONE to the discovery rule. These ‘<a href="https://www.zabbix.com/documentation/4.0/manual/config/macros/lld_macros">lld macros</a>’ are available for use in item,trigger, and graph prototypes.</p>
156
160
 
157
- <p><img src="images/Spectacle.Z29721.png"> <img src="images/Spectacle.l29721.png"></p>
161
+ <p>If you wished to use the above lld to actually do some discovery, you’d set things up in zabbix roughly like this:</p>
158
162
 
159
- <h4 id="label-Zabbix-3A-3ASender-3A-3ASocket+method-3A">Zabbix::Sender::Socket method:</h4>
163
+ <p><img src="images/Spectacle.Z29721.png" alt="Discovery rule configuration" />
164
+ <img src="images/Spectacle.l29721.png" alt="Item prototype configuration" /></p>
160
165
 
161
- <p>You can switch between using the Pipe(zabbix_sender) method and the Socket(direct to zabbix via tcp socket) method very simply. Just change:</p>
166
+ <h4 id="zabbixsendersocket-method">Zabbix::Sender::Socket method:</h4>
162
167
 
163
- <pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_sender'>sender</span> <span class='op'>=</span> <span class='const'><span class='object_link'><a href="Zabbix.html" title="Zabbix (module)">Zabbix</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Zabbix/Sender.html" title="Zabbix::Sender (module)">Sender</a></span></span><span class='op'>::</span><span class='const'><span class='object_link'><a href="Zabbix/Sender/Pipe.html" title="Zabbix::Sender::Pipe (class)">Pipe</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="Zabbix/Sender/Pipe.html#initialize-instance_method" title="Zabbix::Sender::Pipe#initialize (method)">new</a></span></span>
164
- </code></pre>
168
+ <p>You can switch between using the Pipe(zabbix_sender) method and the Socket(direct to zabbix via tcp socket) method very simply. Just change:</p>
165
169
 
166
- <p>to <code> sender = Zabbix::Sender::Socket.new </code></p>
170
+ <p><code>
171
+ sender = Zabbix::Sender::Pipe.new
172
+ </code>
173
+ to
174
+ <code>
175
+ sender = Zabbix::Sender::Socket.new
176
+ </code></p>
167
177
 
168
- <p>If you were specifiying a path to zabbix_sender using the Pipe method, remove that. If you&#39;re using a socket other than 10051 on your server/proxy, you&#39;ll want to add the port: option</p>
178
+ <p>If you were specifiying a path to zabbix_sender using the Pipe method, remove that. If youre using a socket other than 10051 on your server/proxy, youll want to add the port: option</p>
169
179
 
170
- <p>The socket method doesn&#39;t support sending multiple batches between flushes, so you should just use sendBatchAtomic(aBatch) with the Socket method.</p>
180
+ <p>The socket method doesnt support sending multiple batches between flushes, so you should just use sendBatchAtomic(aBatch) with the Socket method.</p>
171
181
 
172
- <p>You don&#39;t have to change anything else - the rest of zabbix_sender_api works exactly the same with the Socket method, save for that it&#39;s arguably more efficient with system resources. The only drawback might be if zabbix changes the sender protocol. At that point until this library is update to support the change you can revert to the Pipe/zabbix_sender method if needed (if they change the command line switches radically there, changes will be required in this library as well).</p>
182
+ <p>You dont have to change anything else - the rest of zabbix_sender_api works exactly the same with the Socket method, save for that its arguably more efficient with system resources. The only drawback might be if zabbix changes the sender protocol. At that point until this library is update to support the change you can revert to the Pipe/zabbix_sender method if needed (if they change the command line switches radically there, changes will be required in this library as well).</p>
173
183
  </div></div>
174
184
 
175
185
  <div id="footer">
176
- Generated on Sat Sep 18 21:55:40 2021 by
177
- <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
178
- 0.9.26 (ruby-2.7.4).
186
+ Generated on Fri Jan 3 16:13:55 2025 by
187
+ <a href="https://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
188
+ 0.9.36 (ruby-3.2.2).
179
189
  </div>
180
190
 
181
191
  </div>
data/public/frames.html CHANGED
@@ -2,13 +2,18 @@
2
2
  <html>
3
3
  <head>
4
4
  <meta charset="utf-8">
5
- <title>Documentation by YARD 0.9.26</title>
5
+ <title>Documentation by YARD 0.9.36</title>
6
6
  </head>
7
7
  <script type="text/javascript">
8
- var match = unescape(window.location.hash).match(/^#!(.+)/);
9
- var name = match ? match[1] : 'index.html';
10
- name = name.replace(/^(\w+):\/\//, '').replace(/^\/\//, '');
11
- window.top.location = name;
8
+ var mainUrl = 'index.html';
9
+ try {
10
+ var match = decodeURIComponent(window.location.hash).match(/^#!(.+)/);
11
+ var name = match ? match[1] : mainUrl;
12
+ var url = new URL(name, location.href);
13
+ window.top.location.replace(url.origin === location.origin ? name : mainUrl);
14
+ } catch (e) {
15
+ window.top.location.replace(mainUrl);
16
+ }
12
17
  </script>
13
18
  <noscript>
14
19
  <h1>Oops!</h1>