Created
June 17, 2020 04:26
-
-
Save rbudiharso/db970804894ff0ec8e427e653c951496 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# create node_exporter.service | |
cat > /etc/systemd/system/node_exporter.service <<END | |
[Unit] | |
Description=node_exporter service | |
After=network.target | |
[Service] | |
ExecStart=/usr/local/bin/node_exporter | |
Type=simple | |
PIDFile=/var/run/node_exporter.pid | |
Restart=on-failure | |
[Install] | |
WantedBy=default.target | |
END | |
chmod 644 /etc/systemd/system/node_exporter.service | |
cd /tmp | |
curl -Ls -o ./node_exporter.tar.gz https://github.com/prometheus/node_exporter/releases/download/v1.0.0/node_exporter-1.0.0.linux-amd64.tar.gz | |
tar xvzpf node_exporter.tar.gz --strip-components=1 | |
chmod 755 ./node_exporter | |
mv ./node_exporter /usr/local/bin/node_exporter | |
systemctl daemon-reload | |
systemctl enable node_exporter.service | |
systemctl start node_exporter.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment