node_exporter-0.14.0.linux-amd64.tar.gz 以及mysqld_exporter-0.10.0.linux-amd64.tar.gz在/home/soft目录下
#!/bin/bash
cd /home/soft
mkdir /usr/local/services
mkdir /usr/local/services/prometheus_exporters
tar zxf node_exporter-0.14.0.linux-amd64.tar.gz -C /usr/local/services/prometheus_exporters --strip-components=1
tar zxf mysqld_exporter-0.10.0.linux-amd64.tar.gz -C /usr/local/services/prometheus_exporters --strip-components=1
cd /usr/local/services/prometheus_exporters
cat << EOF > .my.cnf
[client]
user=root
password=123456
EOF
nohup ./node_exporter > test.log 2>&1 &
nohup ./mysqld_exporter -config.my-cnf=".my.cnf" > test.log 2>&1 &