[Unit] Description=Host metrics to Kafka (Telegraf) Wants=network-online.target After=network-online.target StartLimitIntervalSec=0 [Service] Type=simple User=telegraf Group=telegraf EnvironmentFile=/etc/telegraf/host-metrics/environment ExecStart=/usr/bin/telegraf --config /etc/telegraf/host-metrics/telegraf.conf Restart=always RestartSec=10 TimeoutStopSec=30 StateDirectory=telegraf-host-metrics NoNewPrivileges=true ProtectSystem=strict ProtectHome=read-only PrivateTmp=true ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true # No PrivateDevices/ProtectProc/PrivateNetwork: this service measures the host. # No CAP_SYS_ADMIN or Docker socket is needed. [Install] WantedBy=multi-user.target