Docs » Available host and application monitors » Configure application receivers for hosts and servers » Collectd plugin

Collectd plugin πŸ”—

Description πŸ”—

The Splunk Distribution of OpenTelemetry Collector provides this integration as the collectd/custom monitor type for the Smart Agent Receiver. This monitor lets you provide a custom collectd configuration to be run by the managed collectd instance.

Note

This monitor is not available on Windows as collectd plugins are only supported in Linux and Kubernetes.

You can provide configurations for as many plugins as you want in a single instance of this monitor configuration by either putting multiple <Plugin> blocks in a single template option or by specifying multiple templates.

Note that a distinct instance of collectd is run for each instance of this monitor, so it is more efficient to group plugin configurations into a single monitor configuration (either in one large template text blob or split into multiple templates). If using a discoveryRule, do not group configurations to avoid creating a duplicate configuration for each instance of the service endpoint discovered.

You can also use your own Python plugins in conjunction with the ModulePath option in collectd-python. If your Python plugin has dependencies of its own, you can specify the path to them by specifying multiple ModulePath options with those paths.

Here’s an example of a configuration with a custom Python plugin:

  - type: collectd/custom
    discoveryRule: container_image =~ "myservice"
    template: |
      LoadPlugin "python"
      <Plugin python>
        ModulePath "/usr/lib/python2.7/dist-packages/health_checker"
        Import "health_checker"
        <Module health_checker>
          URL "http://{{.Host}}:{{.Port}}"
          JSONKey "isRunning"
          JSONVal "1"
        </Module>
      </Plugin>

There are many collectd plugins included in the container image that are not exposed as monitors. You can see the plugins in the <AGENT_BUNDLE>/lib/collectd directory, where <AGENT_BUNDLE> is the root of the file system in the containerized version, and is normally /usr/lib/signalfx-agent in the non-containerized agent.

Running the collectd/exec plugin πŸ”—

You can use the collectd/custom monitor to run the collectd/exec plugin. If you are not running the Smart Agent in the container, you can use any appropriate user on your system.

If you are running the Smart Agent in a container, then you need to use a non-root user when you run your script, as shown in the following example:

  - type: collectd/custom
    template: |
      LoadPlugin exec
      <Plugin exec>
        Exec "`non-root user`" "/path/to/script.sh"
      </Plugin>

Replace non-root user with an actual non-root user on your host.

Installation πŸ”—

This monitor is available in the Smart Agent Receiver, which is part of the Splunk Distribution of OpenTelemetry Collector.

To install this integration:

  1. Deploy the Splunk Distribution of OpenTelemetry Collector to your host or container platform.

  2. Configure the monitor, as described in the next section.

Configuration πŸ”—

This Splunk Distribution of OpenTelemetry Collector allows embedding a Smart Agent monitor configuration in an associated Smart Agent Receiver instance.

Note: Providing a Custom monitor entry in your Collector or Smart Agent (deprecated) configuration is required for its use. Use the appropriate form for your agent type.

Splunk Distribution of OpenTelemetry Collector πŸ”—

To activate this monitor in the Splunk Distribution of OpenTelemetry Collector, add the following to your agent configuration:

receivers:
  smartagent/custom:
    type: collectd/custom
    ...  # Additional config

See configuration examples for specific use cases that show how the Splunk Distribution of OpenTelemetry Collector can integrate and complement existing environments.

Smart Agent πŸ”—

To activate this monitor in the Smart Agent, add the following to your agent configuration:

monitors:  # All monitor config goes under this key
 - type: collectd/custom
   ...  # Additional config

See Smart Agent example configuration for an autogenerated example of a YAML configuration file, with default values where applicable.

Configuration settings πŸ”—

The following table shows the configuration options for this monitor:

Option

Required

Type

Description

host

no

string

This option is filled in by the agent if using service discovery. It can be accessed in the provided configuration template with {{.Host}}. This option is set to the hostname or IP address of the discovered service. If you aren’t using service discovery, you can hard code the host/port in the configuration template and ignore these fields.

port

no

integer

This option is filled in by the agent if using service discovery. It can be accessed in the provided configuration template with {{.Port}}. This option is set to the port of the discovered service, if it is a TCP/UDP endpoint. (default: 0)

name

no

string

This option is filled in by the agent if using service discovery. It can be accessed in the provided configuration template with {{.Name}}. This option is set to the name that the observer creates for the endpoint upon discovery. You can generally ignore this field.

template

no

string

A configuration template for collectd. You can include as many plugin blocks as you want in this value. It is rendered as a standard Go template, so be mindful of the delimiters {{ and }}.

templates

no

list of strings

A list of templates, but otherwise equivalent to the above template option. This lets you have a single directory with collectd configuration files and load them all by using a globbed remote configuration value.

collectdReadThreads

no

integer

The number of read threads to use in collectd. This option defaults to the number of templates provided, capped at 10, but if you manually specify it, there is no limit. (default: 0)

Metrics πŸ”—

The Splunk Distribution of OpenTelemetry Collector does not do any built-in filtering of metrics coming out of this monitor.

Get help πŸ”—

If you are not able to see your data in Splunk Observability Cloud, try these tips:

To learn about even more support options, see Splunk Customer Success.