Skip to main content

Systemd units state monitoring with Netdata

Systemd is a suite of basic building blocks for a Linux system.

This module monitors Systemd units state.

  • Works only on linux systems.
  • Disabled by default. Should be explicitly enabled in the go.d.conf:
# go.d.conf
modules:
systemdunits: yes

Charts#

It produces the following charts:

  • Service Unit State in state
  • Socket Unit State in state
  • Target Unit State in state
  • Path Unit State in state
  • Device Unit State in state
  • Mount Unit State in state
  • Automount Unit State in state
  • Swap Unit State in state
  • Timer Unit State in state
  • Scope Unit State in state
  • Slice Unit State in state

Unit states#

CodeNameMeaning
1activestarted, bound, plugged in, ..., depending on the unit type
2inactivestopped, unbound, unplugged, ..., depending on the unit type
3activatingin the process of being activated
4deactivatingin the process of being deactivated
5failedthe service failed in some way (process returned error code on exit, or crashed, an operation timed out, or after too many restarts)

Configuration#

Edit the go.d/systemdunits.conf configuration file using edit-config from the Netdata config directory, which is typically at /etc/netdata.

cd /etc/netdata # Replace this path with your Netdata config directory
sudo ./edit-config go.d/systemdunits.conf

Needs only include option. Syntax is shell file name pattern.

Here are some examples:

jobs:
- name: my-specific-service-unit
include:
- 'my-specific.service'
- name: service-units
include:
- '*.service'
- name: socket-units
include:
- '*.socket'

For all available options, see the Systemdunits collector's configuration file.

Troubleshooting#

To troubleshoot issues with the systemdunits collector, run the go.d.plugin with the debug option enabled. The output should give you clues as to why the collector isn't working.

First, navigate to your plugins directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the setting plugins directory. Once you're in the plugin's directory, switch to the netdata user.

cd /usr/libexec/netdata/plugins.d/
sudo -u netdata -s

You can now run the go.d.plugin to debug the collector:

./go.d.plugin -d -m systemdunits

Reach out

If you need help after reading this doc, search our community forum for an answer. There's a good chance someone else has already found a solution to the same issue.

Documentation

Community