[Unit] Description=Prometheus Node Exporter Documentation=https://github.com/prometheus/node_exporter After=network-online.target Wants=network-online.target [Service] Type=simple User={{ node_exporter_user }} Group={{ node_exporter_group }} ExecStart=/usr/local/bin/node_exporter \ --web.listen-address={{ node_exporter_listen_address }} \ {% for collector in node_exporter_enabled_collectors %} --collector.{{ collector }} \ {% endfor %} {% for collector in node_exporter_disabled_collectors %} --no-collector.{{ collector }} \ {% endfor %} --collector.filesystem.fs-types-exclude="{{ node_exporter_filesystem_ignored_fs_types | join('|') }}" \ --collector.filesystem.mount-points-exclude="{{ node_exporter_filesystem_ignored_mount_points | join('|') }}" Restart=on-failure RestartSec=5s # Security hardening {% if node_exporter_systemd_security %} NoNewPrivileges=true PrivateTmp=true ProtectSystem=strict ProtectHome=true ProtectKernelTunables=true ProtectKernelModules=true ProtectControlGroups=true RestrictRealtime=true RestrictNamespaces=true LockPersonality=true ReadOnlyPaths=/ {% endif %} [Install] WantedBy=multi-user.target