Docs » Integrations Guide » Use the Smart Agent » Monitors » collectd/systemd

collectd/systemd 🔗

Monitor Type: collectd/systemd (Source)

Accepts Endpoints: Yes

Multiple Instances Allowed: Yes

Overview 🔗

This SignalFx Smart Agent monitor collects metrics about the state of configured systemd services using the collectd-systemd plugin. A service is in the state that a metric represents if the metric value is 1 and not in that state if the metric value is 0. The name of the service that the metric is reporiting about is assigned to dimension systemd_service.

The collectd-systemd plugin reads the status of systemd services from host location /var/run/dbus/system_bus_socket. This means that the host location must be mounted to the container in which the SignalFx Smart Agent is running. The agent container must also run in privilege mode. Below is an excerpt of the docker run command.

docker run ...\
  --privileged \
  -v /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket:ro \
...

Below is a sample SignalFx Smart Agent YAML configuration for monitoring the state of docker and ubuntu-fan services. See here for SignalFx Smart Agent configuration details.

monitors:
- type: collectd/systemd
  intervalSeconds: 10
  services:
    - docker
    - ubuntu-fan

Only the metric gauge.substate.running, which indicates whether a service is running or not, gets reported by default. The other metrics must be configure explicitly using the sendActiveState, sendSubState and sendLoadState configuration flags (see below). The metrics are grouped into ActiveState, SubState and LoadState groups.

monitors:
- type: collectd/systemd
  intervalSeconds: 10
  services:
    - docker
    - ubuntu-fan
  sendActiveState: true

Configuration 🔗

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

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

For a list of monitor options that are common to all monitors, see Common Configuration.

Config option Required Type Description
services yes list of strings Systemd services to report on
sendActiveState no bool Flag for sending metrics about the state of systemd services (default: false)
sendSubState no bool Flag for sending more detailed metrics about the state of systemd services (default: false)
sendLoadState no bool Flag for sending metrics about the load state of systemd services (default: false)

Metrics 🔗

These are the metrics available for this monitor. Metrics that are categorized as container/host (default) are in bold and italics in the list below.

  • gauge.active_state.activating (gauge)
    Indicates that the systemd unit/service has previously been inactive but is currently in the process of entering an active state
  • gauge.active_state.active (gauge)
    Indicates that the systemd unit/service is active
  • gauge.active_state.deactivating (gauge)
    Indicates that the systemd unit/service is currently in the process of deactivation
  • gauge.active_state.failed (gauge)
    Indicates that the systemd unit/service is inactive the previous run was not successful
  • gauge.active_state.inactive (gauge)
    Indicates that the systemd unit/service is inactive and the previous run was successful or no previous run has taken place yet
  • gauge.active_state.reloading (gauge)
    Indicates that the systemd unit/service is active and currently reloading its configuration
  • gauge.load_state.error (gauge)
    Indicates that the systemd unit/service configuration failed to load
  • gauge.load_state.loaded (gauge)
    Indicates that the systemd unit/service configuration was loaded and parsed successfully
  • gauge.load_state.masked (gauge)
    Indicates that the systemd unit/service is currently masked out (i.e. symlinked to /dev/null etc)
  • gauge.load_state.not-found (gauge)
    Indicates that the systemd unit/service configuration was not found
  • gauge.substate.dead (gauge)
    Indicates that the systemd unit/service died
  • gauge.substate.exited (gauge)
    Indicates that the systemd unit/service exited
  • gauge.substate.failed (gauge)
    Indicates that the systemd unit/service failed
  • gauge.substate.running (gauge)
    Indicates that the systemd unit/service is running

Group ActiveState 🔗

All of the following metrics are part of the ActiveState metric group. All of the non-default metrics below can be turned on by adding ActiveState to the monitor config option extraGroups:

Group LoadState 🔗

All of the following metrics are part of the LoadState metric group. All of the non-default metrics below can be turned on by adding LoadState to the monitor config option extraGroups:

Group SubState 🔗

All of the following metrics are part of the SubState metric group. All of the non-default metrics below can be turned on by adding SubState to the monitor config option extraGroups:

Non-default metrics (version 4.7.0+) 🔗

To emit metrics that are not default, you can add those metrics in the generic monitor-level extraMetrics config option. Metrics that are derived from specific configuration options that do not appear in the above list of metrics do not need to be added to extraMetrics.

To see a list of metrics that will be emitted you can run agent-status monitors after configuring this monitor in a running agent instance.

Dimensions 🔗

The following dimensions may occur on metrics emitted by this monitor. Some dimensions may be specific to certain metrics.

Name Description
plugin The name of the collectd plugin. Facilitates filtering operations in the SignalFx app
systemd_service The name of the systemd service that the reported metric applies to