Back to the list of connectors[1]

Linux - Service (systemctl)

Description

Gives OS specific service information and metrics

Target

Typical platform: N/A

Operating system: Linux

Prerequisites

Leverages: Linux OsCommands

Technology and protocols: Command Lines

Examples

CLI

metricshub HOSTNAME -t linux -c +LinuxService --ssh -u USER

metricshub.yaml

resourceGroups:
  <RESOURCE_GROUP>:
    resources:
      <HOSTNAME-ID>:
        attributes:
          host.name: <HOSTNAME> # Change with actual host name
          host.type: linux
        selectConnectors: [ LinuxService ] # Optional, to load only this connector
        protocols:
          ssh:
            username: <USERNAME> # Change with actual credentials
            password: <PASSWORD> # Encrypted using metricshub-encrypt

Connector Activation Criteria

The Linux - Service (systemctl) connector will be automatically activated, and its status will be reported as OK if all the below criteria are met:

  • The command below succeeds on the monitored host
    • Command: /usr/bin/systemctl
    • Output contains: UNIT (regex)

Metrics

Type Collected Metrics Specific Attributes
service
  • system.service.status{state="active"}
  • system.service.status{state="dead|exited|running"}
  • system.service.status{state="loaded"}
  • id
No results.