-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
44 additions
and
75 deletions.
There are no files selected for viewing
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
File renamed without changes.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
function node_exporter { | ||
echo "Installing node_exporter ..." | ||
|
||
groupadd -f node_exporter | ||
useradd -g node_exporter --no-create-home --shell /bin/false node_exporter | ||
|
||
cd /tmp | ||
curl -sL https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-arm64.tar.gz | tar xz | ||
cp /tmp/node_exporter-1.7.0.linux-arm64/node_exporter /usr/bin/ | ||
chmod +x /usr/bin/node_exporter | ||
chown node_exporter:node_exporter /usr/bin/node_exporter | ||
|
||
echo "[Unit] | ||
Description=Node Exporter | ||
Documentation=https://prometheus.io/docs/guides/node-exporter/ | ||
Wants=network-online.target | ||
After=network-online.target | ||
[Service] | ||
User=node_exporter | ||
Group=node_exporter | ||
Type=simple | ||
Restart=on-failure | ||
ExecStart=/usr/bin/node_exporter \ | ||
--web.listen-address=:9200 | ||
[Install] | ||
WantedBy=multi-user.target" > /etc/systemd/system/node_exporter.service | ||
|
||
systemctl daemon-reload | ||
systemctl enable node_exporter.service | ||
systemctl start node_exporter.service | ||
|
||
echo "node_exporter installation done!" | ||
} | ||
|
||
node_exporter |