---
date_published: 2026-08-13
date_modified: 2026-08-13
canonical_url: https://metricshub.org/community-connectors/connectors/linuxservice.html
---

 [Supported Platforms](../supported-platforms.html)   [Connectors Directory](../connectors-directory.html)

# Linux - Service (systemctl)

## Description

Gives OS specific service information and metrics

[community](tags/community.html) [linux](tags/linux.html) [system](tags/system.html)

[Source](https://github.com/metricshub/community-connectors/tree/main/src/main/connector/system/LinuxService/LinuxService.yaml)

## Target

Typical platform: **[Linux](platforms/linux.html)**

Operating system: **Linux**

## Prerequisites

Leverages: **Linux OsCommands**

Technology and protocols: **Commands**

Variables:

- `serviceNames`: Regular expression pattern to identify the services to monitor. (default: `.*`)

## Examples

### CLI

```batch
metricshub HOSTNAME -t linux -c +LinuxService --ssh -u USER
```

### metricshub.yaml

```yaml
resourceGroups:
  <RESOURCE_GROUP>:
    resources:
      <HOSTNAME-ID>:
        attributes:
          host.name: <HOSTNAME> # Change with actual host name
          host.type: linux
        connectors: [ +LinuxService ] # Optional, to load only this connector
        protocols:
          ssh:
            username: <USERNAME> # Change with actual credentials
            password: <PASSWORD> # Encrypted using metricshub-encrypt
        additionalConnectors:
          LinuxService: # Unique ID. Use 'uses' if different from the original connector ID
            uses: LinuxService # Optional - Original ID if not in key
            force: true # Optional (default: true); false for auto-detection only
            variables:
              serviceNames: <VALUE> # Replace with desired value.
```

## Connector Activation Criteria

The **Linux - Service (systemctl)** connector **must be selected manually**, 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` |
