systemdunits

package
v0.0.0-...-6ade924 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 8, 2022 License: GPL-3.0 Imports: 13 Imported by: 0

README

Systemd units state monitoring with Netdata

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

This module monitors Systemd units state.

Requirements

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

Metrics

The unit types and states description can be found in the official documentation.

All metrics have "systemd." prefix.

Metric Scope Dimensions Units
service_unit_state unit active, inactive, activating, deactivating, failed state
socket_unit_state unit active, inactive, activating, deactivating, failed state
target_unit_state unit active, inactive, activating, deactivating, failed state
path_unit_state unit active, inactive, activating, deactivating, failed state
device_unit_state unit active, inactive, activating, deactivating, failed state
mount_unit_state unit active, inactive, activating, deactivating, failed state
automount_unit_state unit active, inactive, activating, deactivating, failed state
swap_unit_state unit active, inactive, activating, deactivating, failed state
timer_unit_state unit active, inactive, activating, deactivating, failed state
scope_unit_state unit active, inactive, activating, deactivating, failed state
slice_unit_state unit active, inactive, activating, deactivating, failed state

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 the 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.

  • Navigate to the plugins.d directory, usually at /usr/libexec/netdata/plugins.d/. If that's not the case on your system, open netdata.conf and look for the plugins setting under [directories].

    cd /usr/libexec/netdata/plugins.d/
    
  • Switch to the netdata user.

    sudo -u netdata -s
    
  • Run the go.d.plugin to debug the collector:

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

Documentation

Overview

Package systemdunits is a systemd units states collector

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Include []string     `yaml:"include"`
	Timeout web.Duration `yaml:"timeout"`
}

type SystemdUnits

type SystemdUnits struct {
	module.Base
	Config `yaml:",inline"`
	// contains filtered or unexported fields
}

func New

func New() *SystemdUnits

func (*SystemdUnits) Charts

func (s *SystemdUnits) Charts() *module.Charts

func (*SystemdUnits) Check

func (s *SystemdUnits) Check() bool

func (*SystemdUnits) Cleanup

func (s *SystemdUnits) Cleanup()

func (*SystemdUnits) Collect

func (s *SystemdUnits) Collect() map[string]int64

func (*SystemdUnits) Init

func (s *SystemdUnits) Init() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL