zabbix_sender_api 1.1.1 → 1.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -1
- data/.gitlab-ci.yml +12 -0
- data/CHANGELOG.md +2 -0
- data/README.md +2 -2
- data/lib/zabbix_sender_api/api.rb +0 -2
- data/lib/zabbix_sender_api/version.rb +1 -1
- data/public/Zabbix/AgentConfiguration.html +413 -0
- data/public/Zabbix/Sender/Batch.html +660 -0
- data/public/Zabbix/Sender/Connection.html +650 -0
- data/public/Zabbix/Sender/Discovery.html +597 -0
- data/public/Zabbix/Sender/ItemData.html +678 -0
- data/public/Zabbix/Sender/Pipe.html +461 -0
- data/public/Zabbix/Sender/Socket.html +528 -0
- data/public/Zabbix/Sender.html +115 -0
- data/public/Zabbix.html +117 -0
- data/public/ZabbixSenderApi/Error.html +124 -0
- data/public/ZabbixSenderApi.html +133 -0
- data/public/_index.html +242 -0
- data/public/class_list.html +51 -0
- data/public/css/common.css +1 -0
- data/public/css/full_list.css +58 -0
- data/public/css/style.css +497 -0
- data/public/file.README.html +174 -0
- data/public/file_list.html +56 -0
- data/public/frames.html +17 -0
- data/public/index.html +174 -0
- data/public/js/app.js +314 -0
- data/public/js/full_list.js +216 -0
- data/public/js/jquery.js +4 -0
- data/public/method_list.html +363 -0
- data/public/top-level-namespace.html +110 -0
- data/zabbix_sender_api.gemspec +1 -1
- metadata +30 -4
@@ -0,0 +1,660 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<meta charset="utf-8">
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
6
|
+
<title>
|
7
|
+
Class: Zabbix::Sender::Batch
|
8
|
+
|
9
|
+
— Documentation by YARD 0.9.26
|
10
|
+
|
11
|
+
</title>
|
12
|
+
|
13
|
+
<link rel="stylesheet" href="../../css/style.css" type="text/css" />
|
14
|
+
|
15
|
+
<link rel="stylesheet" href="../../css/common.css" type="text/css" />
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
pathId = "Zabbix::Sender::Batch";
|
19
|
+
relpath = '../../';
|
20
|
+
</script>
|
21
|
+
|
22
|
+
|
23
|
+
<script type="text/javascript" charset="utf-8" src="../../js/jquery.js"></script>
|
24
|
+
|
25
|
+
<script type="text/javascript" charset="utf-8" src="../../js/app.js"></script>
|
26
|
+
|
27
|
+
|
28
|
+
</head>
|
29
|
+
<body>
|
30
|
+
<div class="nav_wrap">
|
31
|
+
<iframe id="nav" src="../../class_list.html?1"></iframe>
|
32
|
+
<div id="resizer"></div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="main" tabindex="-1">
|
36
|
+
<div id="header">
|
37
|
+
<div id="menu">
|
38
|
+
|
39
|
+
<a href="../../_index.html">Index (B)</a> »
|
40
|
+
<span class='title'><span class='object_link'><a href="../../Zabbix.html" title="Zabbix (module)">Zabbix</a></span></span> » <span class='title'><span class='object_link'><a href="../Sender.html" title="Zabbix::Sender (module)">Sender</a></span></span>
|
41
|
+
»
|
42
|
+
<span class="title">Batch</span>
|
43
|
+
|
44
|
+
</div>
|
45
|
+
|
46
|
+
<div id="search">
|
47
|
+
|
48
|
+
<a class="full_list_link" id="class_list_link"
|
49
|
+
href="../../class_list.html">
|
50
|
+
|
51
|
+
<svg width="24" height="24">
|
52
|
+
<rect x="0" y="4" width="24" height="4" rx="1" ry="1"></rect>
|
53
|
+
<rect x="0" y="12" width="24" height="4" rx="1" ry="1"></rect>
|
54
|
+
<rect x="0" y="20" width="24" height="4" rx="1" ry="1"></rect>
|
55
|
+
</svg>
|
56
|
+
</a>
|
57
|
+
|
58
|
+
</div>
|
59
|
+
<div class="clear"></div>
|
60
|
+
</div>
|
61
|
+
|
62
|
+
<div id="content"><h1>Class: Zabbix::Sender::Batch
|
63
|
+
|
64
|
+
|
65
|
+
|
66
|
+
</h1>
|
67
|
+
<div class="box_info">
|
68
|
+
|
69
|
+
<dl>
|
70
|
+
<dt>Inherits:</dt>
|
71
|
+
<dd>
|
72
|
+
<span class="inheritName">Object</span>
|
73
|
+
|
74
|
+
<ul class="fullTree">
|
75
|
+
<li>Object</li>
|
76
|
+
|
77
|
+
<li class="next">Zabbix::Sender::Batch</li>
|
78
|
+
|
79
|
+
</ul>
|
80
|
+
<a href="#" class="inheritanceTree">show all</a>
|
81
|
+
|
82
|
+
</dd>
|
83
|
+
</dl>
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
<dl>
|
96
|
+
<dt>Defined in:</dt>
|
97
|
+
<dd>lib/zabbix_sender_api/api.rb</dd>
|
98
|
+
</dl>
|
99
|
+
|
100
|
+
</div>
|
101
|
+
|
102
|
+
<h2>Overview</h2><div class="docstring">
|
103
|
+
<div class="discussion">
|
104
|
+
|
105
|
+
<p>Batch instances hold all the data and discovery that you collect as your program does its thing with source data. Once you've done all your data collection, you can:</p>
|
106
|
+
<ul><li>
|
107
|
+
<p>Send the batch instance to an instance of Pipe to have it transmitted to zabbix</p>
|
108
|
+
</li><li>
|
109
|
+
<p>puts mybatch.to_senderline to output the zabbix_sender input text </p>
|
110
|
+
</li><li>
|
111
|
+
<p>Use it to help feed data into zabbix by whatever other mechanism you might be using, e.g. a ruby implementation of the zabbix sender protocol</p>
|
112
|
+
</li></ul>
|
113
|
+
|
114
|
+
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
<div class="tags">
|
118
|
+
|
119
|
+
|
120
|
+
</div>
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
<h2>Instance Attribute Summary <small><a href="#" class="summary_toggle">collapse</a></small></h2>
|
125
|
+
<ul class="summary">
|
126
|
+
|
127
|
+
<li class="public ">
|
128
|
+
<span class="summary_signature">
|
129
|
+
|
130
|
+
<a href="#data-instance_method" title="#data (instance method)">#<strong>data</strong> ⇒ Object </a>
|
131
|
+
|
132
|
+
|
133
|
+
|
134
|
+
</span>
|
135
|
+
|
136
|
+
|
137
|
+
|
138
|
+
|
139
|
+
<span class="note title readonly">readonly</span>
|
140
|
+
|
141
|
+
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<span class="summary_desc"><div class='inline'>
|
150
|
+
<p>This is an array of all the ItemData and Discovery instances that have been added to this discovery since instantiation.</p>
|
151
|
+
</div></span>
|
152
|
+
|
153
|
+
</li>
|
154
|
+
|
155
|
+
|
156
|
+
</ul>
|
157
|
+
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
<h2>
|
163
|
+
Instance Method Summary
|
164
|
+
<small><a href="#" class="summary_toggle">collapse</a></small>
|
165
|
+
</h2>
|
166
|
+
|
167
|
+
<ul class="summary">
|
168
|
+
|
169
|
+
<li class="public ">
|
170
|
+
<span class="summary_signature">
|
171
|
+
|
172
|
+
<a href="#addDiscovery-instance_method" title="#addDiscovery (instance method)">#<strong>addDiscovery</strong>(aDiscovery) ⇒ Object </a>
|
173
|
+
|
174
|
+
|
175
|
+
|
176
|
+
</span>
|
177
|
+
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
|
182
|
+
|
183
|
+
|
184
|
+
|
185
|
+
|
186
|
+
<span class="summary_desc"><div class='inline'>
|
187
|
+
<p>Add a discovery object to this batch of data.</p>
|
188
|
+
</div></span>
|
189
|
+
|
190
|
+
</li>
|
191
|
+
|
192
|
+
|
193
|
+
<li class="public ">
|
194
|
+
<span class="summary_signature">
|
195
|
+
|
196
|
+
<a href="#addItemData-instance_method" title="#addItemData (instance method)">#<strong>addItemData</strong>(key: nil, value: nil, timestamp: @time, hostname: @hostname) ⇒ Object </a>
|
197
|
+
|
198
|
+
|
199
|
+
|
200
|
+
</span>
|
201
|
+
|
202
|
+
|
203
|
+
|
204
|
+
|
205
|
+
|
206
|
+
|
207
|
+
|
208
|
+
|
209
|
+
|
210
|
+
<span class="summary_desc"><div class='inline'>
|
211
|
+
<p>Create a new instance of ItemData and add that instance to the list of data that this batch contains.</p>
|
212
|
+
</div></span>
|
213
|
+
|
214
|
+
</li>
|
215
|
+
|
216
|
+
|
217
|
+
<li class="public ">
|
218
|
+
<span class="summary_signature">
|
219
|
+
|
220
|
+
<a href="#appendBatch-instance_method" title="#appendBatch (instance method)">#<strong>appendBatch</strong>(aBatch) ⇒ Object </a>
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
</span>
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
|
234
|
+
<span class="summary_desc"><div class='inline'>
|
235
|
+
<p>Append another batch's data into this one.</p>
|
236
|
+
</div></span>
|
237
|
+
|
238
|
+
</li>
|
239
|
+
|
240
|
+
|
241
|
+
<li class="public ">
|
242
|
+
<span class="summary_signature">
|
243
|
+
|
244
|
+
<a href="#initialize-instance_method" title="#initialize (instance method)">#<strong>initialize</strong>(timestamp: Time.now, hostname: Zabbix::AgentConfiguration.zabbixHostname) ⇒ Batch </a>
|
245
|
+
|
246
|
+
|
247
|
+
|
248
|
+
</span>
|
249
|
+
|
250
|
+
|
251
|
+
<span class="note title constructor">constructor</span>
|
252
|
+
|
253
|
+
|
254
|
+
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
|
260
|
+
<span class="summary_desc"><div class='inline'>
|
261
|
+
<p>Both parameters are optional - reasonable defaults are provided.</p>
|
262
|
+
</div></span>
|
263
|
+
|
264
|
+
</li>
|
265
|
+
|
266
|
+
|
267
|
+
<li class="public ">
|
268
|
+
<span class="summary_signature">
|
269
|
+
|
270
|
+
<a href="#to_senderline-instance_method" title="#to_senderline (instance method)">#<strong>to_senderline</strong> ⇒ Object </a>
|
271
|
+
|
272
|
+
|
273
|
+
|
274
|
+
</span>
|
275
|
+
|
276
|
+
|
277
|
+
|
278
|
+
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
|
284
|
+
<span class="summary_desc"><div class='inline'>
|
285
|
+
<p>Render this batch of data as a sequence of lines of text appropriate for sending into zabbix_sender.</p>
|
286
|
+
</div></span>
|
287
|
+
|
288
|
+
</li>
|
289
|
+
|
290
|
+
|
291
|
+
<li class="public ">
|
292
|
+
<span class="summary_signature">
|
293
|
+
|
294
|
+
<a href="#to_senderstruct-instance_method" title="#to_senderstruct (instance method)">#<strong>to_senderstruct</strong> ⇒ Object </a>
|
295
|
+
|
296
|
+
|
297
|
+
|
298
|
+
</span>
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
|
304
|
+
|
305
|
+
|
306
|
+
|
307
|
+
|
308
|
+
<span class="summary_desc"><div class='inline'>
|
309
|
+
<p>Render this batch as a json object.</p>
|
310
|
+
</div></span>
|
311
|
+
|
312
|
+
</li>
|
313
|
+
|
314
|
+
|
315
|
+
</ul>
|
316
|
+
|
317
|
+
|
318
|
+
<div id="constructor_details" class="method_details_list">
|
319
|
+
<h2>Constructor Details</h2>
|
320
|
+
|
321
|
+
<div class="method_details first">
|
322
|
+
<h3 class="signature first" id="initialize-instance_method">
|
323
|
+
|
324
|
+
#<strong>initialize</strong>(timestamp: Time.now, hostname: Zabbix::AgentConfiguration.zabbixHostname) ⇒ <tt><span class='object_link'><a href="" title="Zabbix::Sender::Batch (class)">Batch</a></span></tt>
|
325
|
+
|
326
|
+
|
327
|
+
|
328
|
+
|
329
|
+
|
330
|
+
</h3><div class="docstring">
|
331
|
+
<div class="discussion">
|
332
|
+
|
333
|
+
<p>Both parameters are optional - reasonable defaults are provided.</p>
|
334
|
+
|
335
|
+
<p>Bear in mind that the hostname and timestamp values you provide here will be applied to all the ItemData and Discovery objects you add via the addItemData() and addDiscovery() methods by default (unless you override them when you add them)</p>
|
336
|
+
|
337
|
+
|
338
|
+
</div>
|
339
|
+
</div>
|
340
|
+
<div class="tags">
|
341
|
+
|
342
|
+
|
343
|
+
</div><table class="source_code">
|
344
|
+
<tr>
|
345
|
+
<td>
|
346
|
+
<pre class="lines">
|
347
|
+
|
348
|
+
|
349
|
+
364
|
350
|
+
365
|
351
|
+
366
|
352
|
+
367
|
353
|
+
368</pre>
|
354
|
+
</td>
|
355
|
+
<td>
|
356
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix_sender_api/api.rb', line 364</span>
|
357
|
+
|
358
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='label'>timestamp:</span> <span class='const'>Time</span><span class='period'>.</span><span class='id identifier rubyid_now'>now</span><span class='comma'>,</span> <span class='label'>hostname:</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="../AgentConfiguration.html" title="Zabbix::AgentConfiguration (class)">AgentConfiguration</a></span></span><span class='period'>.</span><span class='id identifier rubyid_zabbixHostname'><span class='object_link'><a href="../AgentConfiguration.html#zabbixHostname-class_method" title="Zabbix::AgentConfiguration.zabbixHostname (method)">zabbixHostname</a></span></span><span class='rparen'>)</span>
|
359
|
+
<span class='ivar'>@time</span> <span class='op'>=</span> <span class='id identifier rubyid_timestamp'>timestamp</span>
|
360
|
+
<span class='ivar'>@hostname</span> <span class='op'>=</span> <span class='id identifier rubyid_hostname'>hostname</span>
|
361
|
+
<span class='ivar'>@data</span> <span class='op'>=</span> <span class='const'>Array</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span>
|
362
|
+
<span class='kw'>end</span></pre>
|
363
|
+
</td>
|
364
|
+
</tr>
|
365
|
+
</table>
|
366
|
+
</div>
|
367
|
+
|
368
|
+
</div>
|
369
|
+
|
370
|
+
<div id="instance_attr_details" class="attr_details">
|
371
|
+
<h2>Instance Attribute Details</h2>
|
372
|
+
|
373
|
+
|
374
|
+
<span id=""></span>
|
375
|
+
<div class="method_details first">
|
376
|
+
<h3 class="signature first" id="data-instance_method">
|
377
|
+
|
378
|
+
#<strong>data</strong> ⇒ <tt>Object</tt> <span class="extras">(readonly)</span>
|
379
|
+
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
|
384
|
+
</h3><div class="docstring">
|
385
|
+
<div class="discussion">
|
386
|
+
|
387
|
+
<p>This is an array of all the ItemData and Discovery instances that have been added to this discovery since instantiation.</p>
|
388
|
+
|
389
|
+
|
390
|
+
</div>
|
391
|
+
</div>
|
392
|
+
<div class="tags">
|
393
|
+
|
394
|
+
|
395
|
+
</div><table class="source_code">
|
396
|
+
<tr>
|
397
|
+
<td>
|
398
|
+
<pre class="lines">
|
399
|
+
|
400
|
+
|
401
|
+
356
|
402
|
+
357
|
403
|
+
358</pre>
|
404
|
+
</td>
|
405
|
+
<td>
|
406
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix_sender_api/api.rb', line 356</span>
|
407
|
+
|
408
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_data'>data</span>
|
409
|
+
<span class='ivar'>@data</span>
|
410
|
+
<span class='kw'>end</span></pre>
|
411
|
+
</td>
|
412
|
+
</tr>
|
413
|
+
</table>
|
414
|
+
</div>
|
415
|
+
|
416
|
+
</div>
|
417
|
+
|
418
|
+
|
419
|
+
<div id="instance_method_details" class="method_details_list">
|
420
|
+
<h2>Instance Method Details</h2>
|
421
|
+
|
422
|
+
|
423
|
+
<div class="method_details first">
|
424
|
+
<h3 class="signature first" id="addDiscovery-instance_method">
|
425
|
+
|
426
|
+
#<strong>addDiscovery</strong>(aDiscovery) ⇒ <tt>Object</tt>
|
427
|
+
|
428
|
+
|
429
|
+
|
430
|
+
|
431
|
+
|
432
|
+
</h3><div class="docstring">
|
433
|
+
<div class="discussion">
|
434
|
+
|
435
|
+
<p>Add a discovery object to this batch of data. The object will be added to the top of the item list.</p>
|
436
|
+
|
437
|
+
<p>If you did not specifically provide a hostname or a timestamp when you instantiated the Discovery, they'll given the ones provided when this instance of Batch was constructed.</p>
|
438
|
+
|
439
|
+
|
440
|
+
</div>
|
441
|
+
</div>
|
442
|
+
<div class="tags">
|
443
|
+
|
444
|
+
|
445
|
+
</div><table class="source_code">
|
446
|
+
<tr>
|
447
|
+
<td>
|
448
|
+
<pre class="lines">
|
449
|
+
|
450
|
+
|
451
|
+
387
|
452
|
+
388
|
453
|
+
389
|
454
|
+
390
|
455
|
+
391
|
456
|
+
392
|
457
|
+
393
|
458
|
+
394</pre>
|
459
|
+
</td>
|
460
|
+
<td>
|
461
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix_sender_api/api.rb', line 387</span>
|
462
|
+
|
463
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_addDiscovery'>addDiscovery</span><span class='lparen'>(</span><span class='id identifier rubyid_aDiscovery'>aDiscovery</span><span class='rparen'>)</span>
|
464
|
+
<span class='comment'># It doesn't matter right now really as zabbix has to digest the disco
|
465
|
+
</span> <span class='comment'># and won't do it before it tries to process the data, but it makes logical
|
466
|
+
</span> <span class='comment'># sense to put discos first.
|
467
|
+
</span> <span class='id identifier rubyid_aDiscovery'>aDiscovery</span><span class='period'>.</span><span class='id identifier rubyid_timestamp'>timestamp</span> <span class='op'>=</span> <span class='ivar'>@time</span> <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_aDiscovery'>aDiscovery</span><span class='period'>.</span><span class='id identifier rubyid_timestamp'>timestamp</span>
|
468
|
+
<span class='id identifier rubyid_aDiscovery'>aDiscovery</span><span class='period'>.</span><span class='id identifier rubyid_hostname'>hostname</span> <span class='op'>=</span> <span class='ivar'>@hostname</span> <span class='kw'>if</span> <span class='kw'>not</span> <span class='id identifier rubyid_aDiscovery'>aDiscovery</span><span class='period'>.</span><span class='id identifier rubyid_hostname'>hostname</span>
|
469
|
+
<span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_unshift'>unshift</span><span class='lparen'>(</span><span class='id identifier rubyid_aDiscovery'>aDiscovery</span><span class='rparen'>)</span>
|
470
|
+
<span class='kw'>end</span></pre>
|
471
|
+
</td>
|
472
|
+
</tr>
|
473
|
+
</table>
|
474
|
+
</div>
|
475
|
+
|
476
|
+
<div class="method_details ">
|
477
|
+
<h3 class="signature " id="addItemData-instance_method">
|
478
|
+
|
479
|
+
#<strong>addItemData</strong>(key: nil, value: nil, timestamp: @time, hostname: @hostname) ⇒ <tt>Object</tt>
|
480
|
+
|
481
|
+
|
482
|
+
|
483
|
+
|
484
|
+
|
485
|
+
</h3><div class="docstring">
|
486
|
+
<div class="discussion">
|
487
|
+
|
488
|
+
<p>Create a new instance of ItemData and add that instance to the list of data that this batch contains. You must provide a key and a value. You <strong>can</strong> provide a timestamp and a hostname. If you do not provide a timestamp or hostname, they will be given the timestamp and hostname associated with the instance of Batch that you're working with</p>
|
489
|
+
|
490
|
+
|
491
|
+
</div>
|
492
|
+
</div>
|
493
|
+
<div class="tags">
|
494
|
+
|
495
|
+
|
496
|
+
</div><table class="source_code">
|
497
|
+
<tr>
|
498
|
+
<td>
|
499
|
+
<pre class="lines">
|
500
|
+
|
501
|
+
|
502
|
+
375
|
503
|
+
376
|
504
|
+
377</pre>
|
505
|
+
</td>
|
506
|
+
<td>
|
507
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix_sender_api/api.rb', line 375</span>
|
508
|
+
|
509
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_addItemData'>addItemData</span><span class='lparen'>(</span><span class='label'>key:</span> <span class='kw'>nil</span><span class='comma'>,</span><span class='label'>value:</span> <span class='kw'>nil</span><span class='comma'>,</span><span class='label'>timestamp:</span> <span class='ivar'>@time</span><span class='comma'>,</span> <span class='label'>hostname:</span> <span class='ivar'>@hostname</span><span class='rparen'>)</span>
|
510
|
+
<span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_push'>push</span><span class='lparen'>(</span><span class='const'><span class='object_link'><a href="ItemData.html" title="Zabbix::Sender::ItemData (class)">ItemData</a></span></span><span class='period'>.</span><span class='id identifier rubyid_new'><span class='object_link'><a href="ItemData.html#initialize-instance_method" title="Zabbix::Sender::ItemData#initialize (method)">new</a></span></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='comma'>,</span><span class='label'>timestamp:</span> <span class='id identifier rubyid_timestamp'>timestamp</span><span class='comma'>,</span><span class='label'>hostname:</span> <span class='id identifier rubyid_hostname'>hostname</span><span class='rparen'>)</span><span class='rparen'>)</span>
|
511
|
+
<span class='kw'>end</span></pre>
|
512
|
+
</td>
|
513
|
+
</tr>
|
514
|
+
</table>
|
515
|
+
</div>
|
516
|
+
|
517
|
+
<div class="method_details ">
|
518
|
+
<h3 class="signature " id="appendBatch-instance_method">
|
519
|
+
|
520
|
+
#<strong>appendBatch</strong>(aBatch) ⇒ <tt>Object</tt>
|
521
|
+
|
522
|
+
|
523
|
+
|
524
|
+
|
525
|
+
|
526
|
+
</h3><div class="docstring">
|
527
|
+
<div class="discussion">
|
528
|
+
|
529
|
+
<p>Append another batch's data into this one.</p>
|
530
|
+
|
531
|
+
|
532
|
+
</div>
|
533
|
+
</div>
|
534
|
+
<div class="tags">
|
535
|
+
|
536
|
+
|
537
|
+
</div><table class="source_code">
|
538
|
+
<tr>
|
539
|
+
<td>
|
540
|
+
<pre class="lines">
|
541
|
+
|
542
|
+
|
543
|
+
398
|
544
|
+
399
|
545
|
+
400</pre>
|
546
|
+
</td>
|
547
|
+
<td>
|
548
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix_sender_api/api.rb', line 398</span>
|
549
|
+
|
550
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_appendBatch'>appendBatch</span><span class='lparen'>(</span><span class='id identifier rubyid_aBatch'>aBatch</span><span class='rparen'>)</span>
|
551
|
+
<span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_append'>append</span><span class='lparen'>(</span><span class='op'>*</span><span class='id identifier rubyid_aBatch'>aBatch</span><span class='period'>.</span><span class='id identifier rubyid_data'>data</span><span class='rparen'>)</span>
|
552
|
+
<span class='kw'>end</span></pre>
|
553
|
+
</td>
|
554
|
+
</tr>
|
555
|
+
</table>
|
556
|
+
</div>
|
557
|
+
|
558
|
+
<div class="method_details ">
|
559
|
+
<h3 class="signature " id="to_senderline-instance_method">
|
560
|
+
|
561
|
+
#<strong>to_senderline</strong> ⇒ <tt>Object</tt>
|
562
|
+
|
563
|
+
|
564
|
+
|
565
|
+
|
566
|
+
|
567
|
+
</h3><div class="docstring">
|
568
|
+
<div class="discussion">
|
569
|
+
|
570
|
+
<p>Render this batch of data as a sequence of lines of text appropriate for sending into zabbix_sender</p>
|
571
|
+
|
572
|
+
|
573
|
+
</div>
|
574
|
+
</div>
|
575
|
+
<div class="tags">
|
576
|
+
|
577
|
+
|
578
|
+
</div><table class="source_code">
|
579
|
+
<tr>
|
580
|
+
<td>
|
581
|
+
<pre class="lines">
|
582
|
+
|
583
|
+
|
584
|
+
406
|
585
|
+
407
|
586
|
+
408</pre>
|
587
|
+
</td>
|
588
|
+
<td>
|
589
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix_sender_api/api.rb', line 406</span>
|
590
|
+
|
591
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_senderline'>to_senderline</span>
|
592
|
+
<span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_line'>line</span><span class='op'>|</span> <span class='id identifier rubyid_line'>line</span><span class='period'>.</span><span class='id identifier rubyid_to_senderline'>to_senderline</span><span class='rbrace'>}</span><span class='period'>.</span><span class='id identifier rubyid_join'>join</span>
|
593
|
+
<span class='kw'>end</span></pre>
|
594
|
+
</td>
|
595
|
+
</tr>
|
596
|
+
</table>
|
597
|
+
</div>
|
598
|
+
|
599
|
+
<div class="method_details ">
|
600
|
+
<h3 class="signature " id="to_senderstruct-instance_method">
|
601
|
+
|
602
|
+
#<strong>to_senderstruct</strong> ⇒ <tt>Object</tt>
|
603
|
+
|
604
|
+
|
605
|
+
|
606
|
+
|
607
|
+
|
608
|
+
</h3><div class="docstring">
|
609
|
+
<div class="discussion">
|
610
|
+
|
611
|
+
<p>Render this batch as a json object</p>
|
612
|
+
|
613
|
+
|
614
|
+
</div>
|
615
|
+
</div>
|
616
|
+
<div class="tags">
|
617
|
+
|
618
|
+
|
619
|
+
</div><table class="source_code">
|
620
|
+
<tr>
|
621
|
+
<td>
|
622
|
+
<pre class="lines">
|
623
|
+
|
624
|
+
|
625
|
+
412
|
626
|
+
413
|
627
|
+
414
|
628
|
+
415
|
629
|
+
416
|
630
|
+
417
|
631
|
+
418</pre>
|
632
|
+
</td>
|
633
|
+
<td>
|
634
|
+
<pre class="code"><span class="info file"># File 'lib/zabbix_sender_api/api.rb', line 412</span>
|
635
|
+
|
636
|
+
<span class='kw'>def</span> <span class='id identifier rubyid_to_senderstruct'>to_senderstruct</span>
|
637
|
+
<span class='kw'>return</span> <span class='id identifier rubyid_batch'>batch</span> <span class='op'>=</span> <span class='lbrace'>{</span>
|
638
|
+
<span class='label'>request:</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>sender data</span><span class='tstring_end'>"</span></span><span class='comma'>,</span>
|
639
|
+
<span class='label'>data:</span> <span class='ivar'>@data</span><span class='period'>.</span><span class='id identifier rubyid_collect'>collect</span> <span class='lbrace'>{</span><span class='op'>|</span><span class='id identifier rubyid_item'>item</span><span class='op'>|</span> <span class='id identifier rubyid_item'>item</span><span class='period'>.</span><span class='id identifier rubyid_to_senderstruct'>to_senderstruct</span><span class='rbrace'>}</span><span class='comma'>,</span>
|
640
|
+
<span class='label'>clock:</span> <span class='ivar'>@time</span><span class='period'>.</span><span class='id identifier rubyid_to_i'>to_i</span>
|
641
|
+
<span class='rbrace'>}</span>
|
642
|
+
<span class='kw'>end</span></pre>
|
643
|
+
</td>
|
644
|
+
</tr>
|
645
|
+
</table>
|
646
|
+
</div>
|
647
|
+
|
648
|
+
</div>
|
649
|
+
|
650
|
+
</div>
|
651
|
+
|
652
|
+
<div id="footer">
|
653
|
+
Generated on Sat Sep 11 00:00:06 2021 by
|
654
|
+
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
655
|
+
0.9.26 (ruby-2.7.4).
|
656
|
+
</div>
|
657
|
+
|
658
|
+
</div>
|
659
|
+
</body>
|
660
|
+
</html>
|