From: Florian Forster Date: Mon, 29 Aug 2011 13:14:11 +0000 (-0400) Subject: collectd.conf(5): Update ZeroMQ documentation. X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=586e6b4359e47248291a14dd71e2eedaeb77d536;p=collectd.git collectd.conf(5): Update ZeroMQ documentation. Change-Id: I3e50f93f952e8797ce5d8fcc0977677b9ce90a86 --- diff --git a/src/collectd.conf.pod b/src/collectd.conf.pod index d8eba29f..6d37a1f0 100644 --- a/src/collectd.conf.pod +++ b/src/collectd.conf.pod @@ -4764,8 +4764,8 @@ number. =head2 Plugin C This plugin acts as an alternative to the I (you could also use -both). The protocol used is the same binary protocol used by the network -plugin, but this plugin uses the ZeroMQ communication library with can brings +both). The protocol used is the same binary protocol used by the +I, but uses the ZeroMQ communication library with offers interesting features like: =over 4 @@ -4777,28 +4777,89 @@ available again and dropped packets will be sent again. =item -Protocol choice: ZeroMQ can use the TCP, PGM, IPC and "inproc" communication -transports. Check the ZeroMQ documentation for more information on each -transport. +Protocol choice: ZeroMQ can use the TCP, PGM (reliable multicast), IPC and +"inproc" communication transports. Check the ZeroMQ documentation for more +information on each transport. =back Synopsis: - SendDataTo "tcp://localhost:6666" - ListenOn "tcp://*:6666" + Threads 2 + + + HWM 300 + Endpoint "tcp://localhost:6666" + + + Endpoint "tcp://eth0:6666" + Endpoint "tcp://collectd.example.com:6666" + =over 4 -=item B I +=item B I + +Number of threads to use for ZeroMQ communication. Defaults toE1. + +=item B B|B|B|B + +Creates a new communication socket with the given communication model. Please +see L for a discussion of possible socket types. Valid options +are: + +=over 4 + +=item Publish + +Publish values to a list of subscribers. Each value is send to all subscribers, +unless their high water mark has been reached. The B options of this +socket should list I addresses that the publisher should I to. + +=item Subscribe + +Subscribe to values published by a publisher. The B options of this +socket should list I addresses that the subscriber should I +to. + +=item Push + +Send the values in a pipeline fashion to a peer node. If multiple endpoints are +defined, values will be load balanced among those endpoints, i.e. each peer +gets only a subset of all values. The B options of this socket should +list I addresses that the subscriber should I to. -Optional socket to send data to +=item Pull -=item B I +Receive values in a pipeline fashion. If multiple endpoints are defined, reads +from those endpoints are load balanced. The B options of this socket +should list I addresses that the publisher should I to. -Optional socket to listen on +=back + +Inside B blocks, the following options are recognized: + +=over 4 + +=item B I + +Specifies an ZeroMQ endpoint. For I and I sockets this value is +passed to the C function, for I and I sockets it is +passed to the C function. + +Please see L and L for documentation of the target +specification. + +=item B I + +Sets the I (HWM) for the ZeroMQ socket. This is the maximum +amount of outstanding messages that will be queued by ZeroMQ. A value of zero +is interpreted as unlimited. Defaults to not setting this socket option, which +defaults to unlimited message queueing. + +=back =back diff --git a/src/zeromq.c b/src/zeromq.c index ab642a69..ea6399f5 100644 --- a/src/zeromq.c +++ b/src/zeromq.c @@ -338,7 +338,7 @@ static int cmq_config_socket (oconfig_item_t *ci) /* {{{ */ if (status != 0) continue; - if ((type == ZMQ_SUB) || (type == ZMQ_PULL)) + if ((type == ZMQ_PUB) || (type == ZMQ_PULL)) { DEBUG("Binding to %s", value); status = zmq_bind (cmq_socket, value); @@ -350,7 +350,7 @@ static int cmq_config_socket (oconfig_item_t *ci) /* {{{ */ continue; } } - else if ((type == ZMQ_PUB) || (type == ZMQ_PUSH)) + else if ((type == ZMQ_SUB) || (type == ZMQ_PUSH)) { DEBUG("Connecting to %s", value); status = zmq_connect (cmq_socket, value);