Last active
June 25, 2021 20:38
-
-
Save c29r3/1920ea92b1a57b10554b88c97685557d to your computer and use it in GitHub Desktop.
This file contains 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 | |
mkdir /var/lib/node_exporter/textfile_collector | |
cd /tmp | |
curl -LO https://github.com/prometheus/node_exporter/releases/download/v1.1.2/node_exporter-1.1.2.linux-amd64.tar.gz | |
tar -xvf node_exporter*.gz | |
rm node_exporter*.gz /usr/local/bin/node_exporter | |
mv node_exporter*/node_exporter /usr/local/bin/ | |
useradd -rs /bin/false node_exporter | |
echo ' | |
[Unit] | |
Description=Node Exporter | |
After=network.target | |
[Service] | |
User=node_exporter | |
Group=node_exporter | |
Type=simple | |
ExecStart=/usr/local/bin/node_exporter --collector.textfile.directory=/var/lib/node_exporter/textfile_collector | |
[Install] | |
WantedBy=multi-user.target' > /etc/systemd/system/node_exporter.service | |
systemctl daemon-reload | |
systemctl enable node_exporter | |
systemctl start node_exporter | |
systemctl status node_exporter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment