Skip to content

Instantly share code, notes, and snippets.

@onysko
Created September 7, 2021 08:37
Show Gist options
  • Save onysko/e8ce5b45b31414bf20f45e6492441e08 to your computer and use it in GitHub Desktop.
Save onysko/e8ce5b45b31414bf20f45e6492441e08 to your computer and use it in GitHub Desktop.
Node Exporter (prometheus) debian install
# put your version instead of "1.2.2"
wget https://github.com/prometheus/node_exporter/releases/download/v1.2.2/node_exporter-1.2.2.linux-amd64.tar.gz &&
tar xf node_exporter-1.2.2.linux-amd64.tar.gz &&
cd node_exporter-1.2.2.linux-amd64/ &&
cp node_exporter /usr/local/bin &&
useradd --no-create-home --home-dir / --shell /bin/false node_exporter
echo '[Unit]
Description=Prometheus Node Exporter
After=network.target
[Service]
Type=simple
User=node_exporter
Group=node_exporter
ExecStart=/usr/local/bin/node_exporter
SyslogIdentifier=node_exporter
Restart=always
PrivateTmp=yes
ProtectHome=yes
NoNewPrivileges=yes
ProtectSystem=strict
ProtectControlGroups=true
ProtectKernelModules=true
ProtectKernelTunables=yes
[Install]
WantedBy=multi-user.target' > /etc/systemd/system/node_exporter.service &&
systemctl daemon-reload &&
systemctl start node_exporter &&
systemctl status node_exporter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment