tools: node_exporter
This commit is contained in:
parent
3a38665695
commit
2109f609b3
|
@ -0,0 +1,7 @@
|
|||
# 自动安装 node_exporter 脚本
|
||||
|
||||
你可以使用下面命令直接执行
|
||||
|
||||
```shell
|
||||
wget https://git.mczhengyi.top/zhengyi/tools/raw/branch/main/node_exporter/install.sh | sudo bash
|
||||
```
|
|
@ -0,0 +1,32 @@
|
|||
#!/bin/bash
|
||||
|
||||
# AUTO INSTALL NODE EXPORTER
|
||||
# AUTHOR: zhengyi59
|
||||
|
||||
echo -e "\033[32mDownloading Node Exporter...... \033[0m"
|
||||
wget https://github.com/prometheus/node_exporter/releases/download/v1.7.0/node_exporter-1.7.0.linux-amd64.tar.gz
|
||||
tar -xzvf node_exporter-1.7.0.linux-amd64.tar.gz
|
||||
|
||||
|
||||
echo -e "\033[32mInstalling Node Exporter...... \033[0m"
|
||||
mv node_exporter-1.7.0.linux-amd64/node_exporter /usr/bin
|
||||
rm -rf node_exporter-1.7.0.linux-amd64*
|
||||
|
||||
echo -e "\033[32mCreating Services...... \033[0m"
|
||||
echo '[Unit]
|
||||
Description=Node Exporter
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/node_exporter --collector.textfile.directory=/tmp/metrics --web.listen-address=:9100
|
||||
Restart=on-failure
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target' > /etc/systemd/system/node_exporter.service
|
||||
systemctl start node_exporter
|
||||
systemctl enable node_exporter
|
||||
|
||||
echo -e '\033[32mYour Node Exporter Was Configured
|
||||
You can get metrics in http://<your_ip>:9100/metrics
|
||||
\033[0m'
|
Loading…
Reference in New Issue