forked from petarnikolovski/prometheus-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
node.sh
executable file
·22 lines (16 loc) · 844 Bytes
/
node.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
# Make node_exporter user
sudo adduser --no-create-home --disabled-login --shell /bin/false --gecos "Node Exporter User" node_exporter
# Download node_exporter and copy utilities to where they should be in the filesystem
wget https://github.com/prometheus/node_exporter/releases/download/v0.15.2/node_exporter-0.15.2.linux-amd64.tar.gz
tar xvzf node_exporter-0.15.2.linux-amd64.tar.gz
sudo cp node_exporter-0.15.2.linux-amd64/node_exporter /usr/local/bin/
sudo chown node_exporter:node_exporter /usr/local/bin/node_exporter
# systemd
cat ./node/node_exporter.service | sudo tee /etc/systemd/system/node_exporter.service
sudo systemctl daemon-reload
sudo systemctl enable node_exporter
sudo systemctl start node_exporter
# Installation cleanup
rm node_exporter-0.15.2.linux-amd64.tar.gz
rm -rf node_exporter-0.15.2.linux-amd64