collectd: Send metrics to collectd
The collectd() destination uses the unixsock plugin of the collectd application to send log messages to the collectd system statistics collection daemon. You must install and configure collectd separately before using this destination.
Prerequisites
-
AxoSyslog version 3.20 or later.
-
Install the
axosyslog-sclpackage on Debian/Ubuntu. On RHEL and compatible distributions, the SCL files are part of theaxosyslogbase package.Your configuration must also contain
@include "scl.conf", which the default configuration file already does. If the SCL files are missing, AxoSyslog fails to start with anunexpected LL_IDENTIFIERerror.Terminal window @include "scl.conf"The
collectd()driver is a reusable configuration snippet (SCL). For details on using or writing such configuration snippets, see Reusing configuration blocks. You can find its source in scl/collectd/plugin.conf on GitHub.
Declaration:
destination d_collectd {
collectd(
socket("<path-to-collectd-socket>"),
host("${HOST}"),
plugin("${PROGRAM}"),
type("<type-of-the-collected-metric>"),
values("<metric-sent-to-collectd>"),
);
};Example: Using the collectd() driver
The following example uses the name of the application sending the log message as the plugin name, and the value of the ${SEQNUM} macro as the value of the metric sent to collectd.
destination d_collectd {
collectd(
socket("/var/run/collectd-unixsock"),
host("${HOST}"),
plugin("${PROGRAM}"),
type("gauge"),
type_instance("seqnum"),
values("${SEQNUM}"),
);
};