Setup node_exporter on Proxmox

Setup node_exporter on Proxmox

node_exporter is one of the most useful exporters for your Prometheus/Grafana installation, providing a wealth of statistics about the state of your servers/nodes.

These are the steps we used to install node_exporter on our Proxmox nodes.

Download and extract binary:

$ wget https://github.com/prometheus/node_exporter/releases/download/v0.16.0/node_exporter-0.16.0.linux-amd64.tar.gz
...
$ tar xvf node_exporter-0.16.0.linux-amd64.tar.gz
$ cd node_exporter-0.16.0.linux-amd64/

Create user to run node_exporter

$ useradd --no-create-home --shell /bin/false node_exporter

Copy binary to /usr/local/bin and modify owner:

$ cp node_exporter /usr/local/bin/.
$ chown node_exporter:node_exporter  /usr/local/bin/node_exporter

Create service entry for node_exporter. Create /etc/systemd/system/node_exporter.service:

[Unit]
Description=Node Exporter
Wants=network-online.target
After=network-online.target

[Service]
User=node_exporter
Group=node_exporter
Type=simple
ExecStart=/usr/local/bin/node_exporter
# ExecStart=/usr/local/bin/node_exporter --collectors.enabled meminfo,loadavg,filesystem

[Install]
WantedBy=multi-user.target

Enable service and check it is running:

$ systemctl daemon-reload
$ systemctl start node_exporter
$ systemctl status node_exporter
systemctl status node_exporter
● node_exporter.service - Node Exporter
   Loaded: loaded (/etc/systemd/system/node_exporter.service; disabled; vendor preset: enabled)
   Active: active (running) since Sun 2018-06-10 14:10:42 MDT; 7s ago
 Main PID: 3456142 (node_exporter)
    Tasks: 5 (limit: 4915)
   Memory: 2.1M
      CPU: 9ms
   CGroup: /system.slice/node_exporter.service
           └─3456142 /usr/local/bin/node_exporter

Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - stat" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - textfile" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - time" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - timex" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - uname" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - vmstat" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - wifi" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - xfs" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg=" - zfs" source="node_exporter.go:97"
Jun 10 14:10:42 superdave node_exporter[3456142]: time="2018-06-10T14:10:42-06:00" level=info msg="Listening on :9100" source="node_exporter.go:111"

Configure to start at boot:

$ systemctl enable node_exporter
Created symlink /etc/systemd/system/multi-user.target.wants/node_exporter.service → /etc/systemd/system/node_exporter.service.

Then you are done. You just need to setup a target in Prometheus.


Many of these steps were re-purposed from
https://www.digitalocean.com/community/tutorials/how-to-install-prometheus-on-ubuntu-16-04

Leave a Reply

Your email address will not be published. Required fields are marked *