Host agents: Telegraf, FreeBSD, AIX, Solaris and other Unix

Telegraf (Linux, Windows, FreeBSD, macOS)

Telegraf is often already installed. It sends its JSON output to /telegraf on the same port. Add to telegraf.conf:

[agent]
  interval = "60s"
  flush_interval = "60s"

[[inputs.cpu]]
  percpu = false
  totalcpu = true
[[inputs.mem]]
[[inputs.swap]]
[[inputs.disk]]
  ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
[[inputs.net]]
[[inputs.system]]

[[outputs.http]]
  url = "https://NETLENS:4318/telegraf"
  method = "POST"
  data_format = "json"            # required
  use_batch_format = true
  content_encoding = "gzip"
  tls_ca   = "/etc/netlens-agent/ca.pem"
  tls_cert = "/etc/netlens-agent/agent.crt"
  tls_key  = "/etc/netlens-agent/agent.key"
  [outputs.http.headers]
    Content-Type = "application/json"
  • Linux: install the Telegraf package from your repository or from the vendor (telegraf), put the files where the telegraf user can read them, systemctl enable --now telegraf.
  • Windows: unpack telegraf-<version>_windows_amd64.zip, then telegraf.exe --service install --config "C:\Program Files\Telegraf\telegraf.conf" and telegraf.exe --service start; use the certificate paths under C:\ProgramData\netlens-agent\.
  • FreeBSD: pkg install telegraf, put the config in /usr/local/etc/telegraf.conf, sysrc telegraf_enable=YES, service telegraf start. Telegraf is the supported collector there (the OpenTelemetry Collector has no FreeBSD build).
  • macOS: brew install telegraf (or the OpenTelemetry Collector darwin tarball).

Telegraf measurements used: cpu (the cpu-total row), mem, swap, disk, net, system. Others are ignored.

AIX, Solaris, HP-UX and other Unix

  • AIX: an otelcol-contrib_<version>_aix_ppc64.tar.gz build exists on the releases page. Unpack it and use the configuration above with a service or inittab entry of your choice. We could not run it on AIX; which hostmetrics scrapers deliver data there is up to the collector, so check the result in Netlens.
  • Solaris, HP-UX and anything else without a collector: use the small shell script contrib/netlens-push.sh. It is plain POSIX sh, read-only, and sends load, uptime and disk usage with curl and the host’s certificate. Run it from cron every minute:

sh * * * * * NETLENS_URL=https://NETLENS:4318/telegraf NETLENS_DIR=/etc/netlens-agent /opt/netlens/netlens-push.sh

Check what it would send first: NETLENS_DRY_RUN=1 NETLENS_URL=x ./netlens-push.sh. The script is tested on Linux (dash, bash, busybox). On Solaris set NETLENS_DF=/usr/xpg4/bin/df; on HP-UX df -P may need adapting. To send more (processor, memory, network), add objects in the format below from vmstat, sar or kstat of that system.