ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/AnyEvent-ZabbixSender/README
Revision: 1.1
Committed: Thu Jan 18 10:17:15 2018 UTC (6 years, 10 months ago) by root
Branch: MAIN
Log Message:
*** empty log message ***

File Contents

# Content
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 on_error => $cb->(\@items, $msg) (default: log and continue)
56 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 on_loss => $cb->(\@items) (default: not called)
61 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 on_response => $cb->(\@items, \%response) (default: not called)
66 Will be called with the (generally rather useless) response form
67 the zabbix server.
68
69 $zbx->submit ($k, $v[, $clock[, $host]])
70 Submits a new key-value pair to the zabbix server. If $clock is
71 missing or "undef", then "AE::now" is used for the event timestamp.
72 If $host is missing, then the default set during object creation is
73 used.
74
75 $zbx->submit_multiple ([ [$k, $v, $clock, $host]... ])
76 Like "submit", but submits many key-value pairs at once.
77
78 SEE ALSO
79 AnyEvent.
80
81 AUTHOR
82 Marc Lehmann <schmorp@schmorp.de>
83 http://home.schmorp.de/
84