Collectd Listener

Overview

This plugin is ported from the Telegraf Socket Listener Service Input Plugin. The Collectd Listener is a service input plugin that listens for messages from collectd’s network plugin.

Setup

The collectd_listener plugin is included with the AppOptics host agent by default, please follow the directions below to enable it for a host agent instance.

Prerequisites

The Collectd Listener expects that you have collectd installed on your system. Here’s an example of a configuration stored in /etc/collectd/collectd.conf:

FQDNLookup true
Interval 60

LoadPlugin logfile
LoadPlugin syslog

<Plugin logfile>
        LogLevel "info"
        File "/var/log/collectd.log"
        Timestamp true
        PrintSeverity false
</Plugin>

<Plugin syslog>
        LogLevel info
</Plugin>

##############################################################################
# LoadPlugin section                                                         #
##############################################################################

LoadPlugin cpu
LoadPlugin disk
LoadPlugin memory
LoadPlugin network

##############################################################################
# Plugin configuration                                                       #
##############################################################################

<Plugin "network">
  Server "127.0.0.1" "28527"
</Plugin>

<Include "/etc/collectd/collectd.conf.d">
        Filter "*.conf"
</Include>

This example collects cpu, disk, and memory metrics and sends them via UDP to the IP and port specified in the network section. After making changes to collectd.conf, make sure you restart the service with:

$ sudo service collectd restart

Configuration

The host agent provides an example configuration file to help you get started quickly. It defines the plugin and task file to be loaded by the agent, but requires you to provide the correct settings for your installation. To enable the plugin:

  1. Make a copy of the collectd_listener example configuration file /opt/appoptics/etc/plugins.d/collectd_listener.yaml.example, renaming it to /opt/appoptics/etc/plugins.d/collectd_listener.yaml:
$ sudo cp /opt/appoptics/etc/plugins.d/collectd_listener.yaml.example /opt/appoptics/etc/plugins.d/collectd_listener.yaml
  1. Update the /opt/appoptics/etc/plugins.d/collectd_listener.yaml configuration file with settings specific to your use case, for example:
collector:
  collectd_listener:
    all:
      ## URL to listen on
      service_address: "udp://127.0.0.1:28527"

      ## Maximum number of concurrent connections.
      ## Only applies to stream sockets (e.g. TCP).
      ## 0 (default) is unlimited.
      # max_connections: 1024

      ## Read timeout.
      ## Only applies to stream sockets (e.g. TCP).
      ## 0 (default) is unlimited.
      # read_timeout: "30s"

      ## Maximum socket buffer size in bytes.
      ## For stream sockets, once the buffer fills up, the sender will start backing up.
      ## For datagram sockets, once the buffer fills up, metrics will start dropping.
      ## Defaults to the OS default.
      # read_buffer_size: 65535

      ## Period between keep alive probes.
      ## Only applies to TCP sockets.
      ## 0 disables keep alive probes.
      ## Defaults to the OS configuration.
      # keep_alive_period: "5m"

      ## Metric name prefix
      bridge_prefix: "collectd"
      # bridge_prefix: ""

load:
  plugin: snap-plugin-collector-bridge-collectd_listener
  task: task-bridge-collectd_listener.yaml
  1. Restart the host agent:
$ sudo service appoptics-snapteld restart
  1. Enable the collectd_listener plugin

    When you log in to AppOptics you should see the collectd_listener listed in the Plugin section on the home page. You will also find it on the Integrations Page. Clicking on the widget will open up a window that shows you the list of metrics that the plugin is collecting. Activate the plugin by clicking on the “Enable Plugin” button, then select the metrics you would like to see on a dashboard and click on the “Send Metrics to Dashboard” button.

Metrics

The collected metrics will be prefixed with collectd.* in AppOptics (or the configured value for bridge_prefix on the plugin configuration).

For more information read the Telegraf Socket Listener Service Input Plugin docs.