other plugins, its documentation has been moved to an own manpage,
L<collectd-snmp(5)>. Please see there for details.
+=head2 Plugin C<statsd>
+
+The I<statsd plugin> listens to a UDP socket, reads "events" in the statsd
+protocol and dispatches rates or other aggregates of these numbers
+periodically.
+
+The following configuration options are valid:
+
+=over 4
+
+=item B<Host> I<Host>
+
+Bind to the hostname / address I<Host>. By default, the plugin will bind to the
+"any" address, i.e. accept packets sent to any of the hosts addresses.
+
+=item B<Port> I<Port>
+
+UDP port to listen to. This can be either a service name or a port number.
+Defaults to C<8125>.
+
+=back
+
=head2 Plugin C<swap>
The I<Swap plugin> collects information about used and available swap space. On
return ((void *) 0);
} /* }}} void *statsd_network_thread */
+static int statsd_config (oconfig_item_t *ci) /* {{{ */
+{
+ int i;
+
+ for (i = 0; i < ci->children_num; i++)
+ {
+ oconfig_item_t *child = ci->children + i;
+
+ if (strcasecmp ("Host", child->key) == 0)
+ cf_util_get_string (child, &conf_node);
+ else if (strcasecmp ("Port", child->key) == 0)
+ cf_util_get_service (child, &conf_service);
+ /* TODO: Add configuration for Delete{Counters,Timers,Gauges} */
+ else
+ ERROR ("statsd plugin: The \"%s\" config option is not valid.",
+ child->key);
+ }
+
+ return (0);
+} /* }}} int statsd_config */
+
static int statsd_init (void) /* {{{ */
{
pthread_mutex_lock (&metrics_lock);
}
i = c_avl_get_iterator (metrics_tree);
+ /* TODO: Delete legacy metrics */
while (c_avl_iterator_next (i, (void *) &name, (void *) &metric) == 0)
statsd_metric_submit (name, metric);
c_avl_iterator_destroy (i);
c_avl_destroy (metrics_tree);
metrics_tree = NULL;
+ sfree (conf_node);
+ sfree (conf_service);
+
pthread_mutex_unlock (&metrics_lock);
return (0);
void module_register (void)
{
+ plugin_register_complex_config ("statsd", statsd_config);
plugin_register_init ("statsd", statsd_init);
plugin_register_read ("statsd", statsd_read);
plugin_register_shutdown ("statsd", statsd_shutdown);