Host agents: the collector on Debian, Ubuntu, Red Hat family and SUSE

Every example sends the same readings. Replace NETLENS with a name from the server certificate. The OpenTelemetry Collector must be the contrib distribution (otelcol-contrib), which has the hostmetrics receiver.

The configuration (OpenTelemetry Collector)

receivers:
  hostmetrics:                       # newer versions call it host_metrics; the old name still works there
    collection_interval: 60s
    scrapers:
      cpu: {}
      memory: {}
      load: {}
      paging: {}
      filesystem: {}
      network: {}
      system: {}                     # uptime
processors:
  batch:
    timeout: 10s
exporters:
  otlphttp:                          # newer versions: otlp_http
    endpoint: https://NETLENS:4318
    encoding: json                   # required: Netlens accepts JSON only
    compression: gzip
    tls:
      ca_file: /etc/otelcol-contrib/netlens/ca.pem
      cert_file: /etc/otelcol-contrib/netlens/agent.crt
      key_file: /etc/otelcol-contrib/netlens/agent.key
service:
  pipelines:
    metrics:
      receivers: [hostmetrics]
      processors: [batch]
      exporters: [otlphttp]

otelcol-contrib components lists the names your version knows. The batch processor groups the readings; the resource or host.name settings are not needed for an agent linked to one device (the name in the data is ignored).

Debian and Ubuntu

curl -LO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.164.0/otelcol-contrib_0.164.0_linux_amd64.deb
sudo dpkg -i otelcol-contrib_0.164.0_linux_amd64.deb         # creates the user and the service "otelcol-contrib"
sudo install -d -m 0750 -o root -g otelcol-contrib /etc/otelcol-contrib/netlens
sudo cp /etc/netlens-agent/{ca.pem,agent.crt,agent.key} /etc/otelcol-contrib/netlens/
sudo chown root:otelcol-contrib /etc/otelcol-contrib/netlens/*; sudo chmod 0640 /etc/otelcol-contrib/netlens/agent.key
sudoedit /etc/otelcol-contrib/config.yaml                    # the configuration above
sudo systemctl enable --now otelcol-contrib
journalctl -u otelcol-contrib -f                             # no errors; in Netlens the agent shows "last data a moment ago"

Use _linux_arm64.deb on ARM. Pick the current version from the releases page.

Red Hat Enterprise Linux, Rocky, AlmaLinux, Oracle Linux, Amazon Linux, Fedora

curl -LO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.164.0/otelcol-contrib_0.164.0_linux_amd64.rpm
sudo dnf install ./otelcol-contrib_0.164.0_linux_amd64.rpm   # (yum on RHEL 7)
# then exactly as on Debian: certificate folder, chown/chmod, config.yaml, and
sudo systemctl enable --now otelcol-contrib                  # the package does not enable the service by itself on RPM systems

With SELinux enforcing keep the files under /etc/otelcol-contrib/ as shown; the collector runs unconfined. (The package install and the file locations were checked on Rocky Linux 9; SELinux enforcing was not.) s390x and ppc64le packages exist for IBM Z and Power.

SUSE Linux Enterprise and openSUSE

curl -LO https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.164.0/otelcol-contrib_0.164.0_linux_amd64.rpm
sudo zypper --no-gpg-checks install ./otelcol-contrib_0.164.0_linux_amd64.rpm
# certificate folder, chown/chmod and config.yaml as on Debian, then
sudo systemctl enable --now otelcol-contrib

The package is not signed, hence --no-gpg-checks; verify the download against the checksum published with the release instead.