Skip to content

Instantly share code, notes, and snippets.

@jarek-przygodzki
Last active May 31, 2024 16:11
Show Gist options
  • Save jarek-przygodzki/735e15337a3502fea40beba27e193b04 to your computer and use it in GitHub Desktop.
Save jarek-przygodzki/735e15337a3502fea40beba27e193b04 to your computer and use it in GitHub Desktop.
Installing node_exporter as systemd serivice
sudo useradd --system --shell /bin/false node_exporter
curl -fsSL https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz \
  | sudo tar -zxvf - -C /usr/local/bin --strip-components=1 node_exporter-1.3.1.linux-amd64/node_exporter \
  && sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
sudo tee /etc/systemd/system/node_exporter.service <<"EOF"
[Unit]
Description=Node Exporter

[Service]
User=node_exporter
Group=node_exporter
EnvironmentFile=-/etc/sysconfig/node_exporter
ExecStart=/usr/local/bin/node_exporter $OPTIONS

[Install]
WantedBy=multi-user.target
EOF
sudo systemctl daemon-reload && \
sudo systemctl start node_exporter && \
sudo systemctl status node_exporter && \
sudo systemctl enable node_exporter
@Firxiao
Copy link

Firxiao commented Nov 20, 2020

@NickThorne123
Copy link

NickThorne123 commented Mar 14, 2022

The branch got merged into master (started on that branch for animated schematics by accident so just PR'd it to master).
Now have node_exporter running on the temporary Droplet. And local prom on 9090 and local Grafana on 3000 with the node exporter full dashboard showing the stats for the remote DO instance.

Note that It's not recommended to deploy it as a Docker container because it requires access to the host system.

So there's a task to repeat this 'bare metal' install on do-set.
But first we will try to get the 'bare metal' CH install running on DO.
Then try the dockerised CH with metrics on DO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment