1 |
root |
1.1 |
NAME |
2 |
|
|
AnyEvent::ZabbixSender - simple and efficient zabbix data submission |
3 |
|
|
|
4 |
|
|
SYNOPSIS |
5 |
|
|
use AnyEvent::ZabbixSender; |
6 |
|
|
|
7 |
|
|
DESCRIPTION |
8 |
|
|
This module is an AnyEvent user, you need to make sure that you use and |
9 |
|
|
run a supported event loop. |
10 |
|
|
|
11 |
|
|
I't implements the zabbix version 2.0-3.4 protocol for item data |
12 |
|
|
submission. |
13 |
|
|
|
14 |
|
|
METHODS |
15 |
|
|
$zbx = new AnyEvent::ZabbixSender [key => value...] |
16 |
|
|
Creates a (virtual) connection to a zabbix server. Since each |
17 |
|
|
submission requires a new TCP connection, creating the connection |
18 |
|
|
object does not actually contact the server. |
19 |
|
|
|
20 |
|
|
The connection object will linger in the destructor until all data |
21 |
|
|
has been submitted or thrown away. |
22 |
|
|
|
23 |
|
|
You can specify various configuration parameters. The term @items |
24 |
|
|
refers to an array with "[key, value, clock]" array-refs. |
25 |
|
|
|
26 |
|
|
server => "$hostname:$port" (default: "localhost:10051") |
27 |
|
|
The zabbix server to connect to. |
28 |
|
|
|
29 |
|
|
host => $name (default: local nodename) |
30 |
|
|
The submission host, the "technical" name from tghe zabbix |
31 |
|
|
configuration. |
32 |
|
|
|
33 |
|
|
delay => $seconds (default: 0) |
34 |
|
|
If non-zero, then the module will gather data submissions for up |
35 |
|
|
to this number of seconds before actually submitting them as a |
36 |
|
|
single batch. |
37 |
|
|
|
38 |
|
|
Submissions can get batched even if 0, as events submitted while |
39 |
|
|
the connection is being established or retried will be batched |
40 |
|
|
together in any case. |
41 |
|
|
|
42 |
|
|
queue_time => $seconds (default: 3600) |
43 |
|
|
The amount of time a data item will be queued until it is thrown |
44 |
|
|
away when the server cannot be reached. |
45 |
|
|
|
46 |
|
|
linger_time => $seconds (default: same as "queue_time") |
47 |
|
|
The amount of time the module will linger in its destructor |
48 |
|
|
until all items have been submitted. |
49 |
|
|
|
50 |
|
|
retry_min => $seconds (default: 30) |
51 |
|
|
retry_max => $seconds (default: 300) |
52 |
|
|
The minimum and maximum retry times when the server cannot be |
53 |
|
|
reached. |
54 |
|
|
|
55 |
root |
1.2 |
on_error => $cb->($zbx, \@items, $msg) (default: log and continue) |
56 |
root |
1.1 |
Called on any protocol errors - these generally indicate that |
57 |
|
|
something other than a zabbix server is running on a port. The |
58 |
|
|
given key-value pairs are the lost items. |
59 |
|
|
|
60 |
root |
1.2 |
on_loss => $cb->$zbx, (\@items) (default: log and continue) |
61 |
root |
1.1 |
Will be called when some data items are thrown away (this |
62 |
|
|
happens if the server isn't reachable for at least "queue_time" |
63 |
|
|
seconds), |
64 |
|
|
|
65 |
root |
1.2 |
on_response => $cb->$zbx, (\@items, \%response) (default: not |
66 |
|
|
called) |
67 |
root |
1.1 |
Will be called with the (generally rather useless) response form |
68 |
|
|
the zabbix server. |
69 |
|
|
|
70 |
|
|
$zbx->submit ($k, $v[, $clock[, $host]]) |
71 |
|
|
Submits a new key-value pair to the zabbix server. If $clock is |
72 |
|
|
missing or "undef", then "AE::now" is used for the event timestamp. |
73 |
|
|
If $host is missing, then the default set during object creation is |
74 |
|
|
used. |
75 |
|
|
|
76 |
|
|
$zbx->submit_multiple ([ [$k, $v, $clock, $host]... ]) |
77 |
|
|
Like "submit", but submits many key-value pairs at once. |
78 |
|
|
|
79 |
|
|
SEE ALSO |
80 |
|
|
AnyEvent. |
81 |
|
|
|
82 |
|
|
AUTHOR |
83 |
|
|
Marc Lehmann <schmorp@schmorp.de> |
84 |
|
|
http://home.schmorp.de/ |
85 |
|
|
|