Skip to content

Instantly share code, notes, and snippets.

@saitoxu
Last active March 22, 2018 04:09
Show Gist options
  • Save saitoxu/f306aa1461f602b07138ee27f91df726 to your computer and use it in GitHub Desktop.
Save saitoxu/f306aa1461f602b07138ee27f91df726 to your computer and use it in GitHub Desktop.
how to install node_exporter (CentOS 7.4)
$ sudo su -
$ cd /opt
$ wget https://github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.linux-amd64.tar.gz
$ tar xzvf node_exporter-0.15.2.linux-amd64.tar.gz
$ mv node_exporter-0.15.2.linux-amd64.tar.gz /usr/local/src/
$ mv node_exporter-0.15.2.linux-amd64 node_exporter
$ vim /etc/systemd/system/node_exporter.service
$ vim /etc/default/node_exporter
$ systemctl daemon-reload
$ systemctl enable node_exporter.service
$ systemctl start node_exporter.service
$ systemctl status -l node_exporter.service
[Unit]
Description=Node exporter for prometheus
After=network.target
[Service]
Type=simple
EnvironmentFile=-/etc/default/node_exporter
ExecStart=/opt/node_exporter/node_exporter $OPTIONS
PrivateTmp=true
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment