Files

35 lines
832 B
Django/Jinja
Raw Permalink Normal View History

# nvidia_gpu_exporter - Prometheus exporter for NVIDIA GPUs via NVML
#
# Exposes GPU metrics at /metrics port {{ nvidia_exporter_port }}
[Unit]
Description=NVIDIA GPU Prometheus Exporter
After=network-online.target
Wants=network-online.target
[Service]
Type=simple
User={{ nvidia_exporter_user }}
Group={{ nvidia_exporter_user }}
WorkingDirectory={{ nvidia_exporter_install_dir }}
Environment="PYTHONUNBUFFERED=1"
ExecStart={{ nvidia_exporter_venv_path }}/bin/python3 {{ nvidia_exporter_script_path }}
Restart=on-failure
RestartSec=5
TimeoutStopSec=10
StandardOutput=journal
StandardError=journal
# Security hardening
NoNewPrivileges=true
ProtectSystem=strict
ProtectHome=true
ReadOnlyPaths=/sys
PrivateTmp=true
ProtectKernelTunables=true
ProtectKernelModules=true
ProtectControlGroups=true
[Install]
WantedBy=multi-user.target