1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
| wget https://github.com/prometheus/node_exporter/releases/download/v1.5.0/node_exporter-1.5.0.linux-amd64.tar.gz nohup ./node_exporter --web.config.file=config.yml --web.listen-address=:19100 2>&1 & open http://192.168.101.211:19100
cat << EOF >/etc/systemd/system/node_exporter.service [Unit] Description=node_exporter Monitoring System Documentation=node_exporter Monitoring System [Service] ExecStart=/opt/node_exporter/node_exporter --web.config.file=/opt/node_exporter/config.yml --web.listen-address=:19100 [Install] WantedBy=multi-user.target EOF
systemctl daemon-reload systemctl start node_exporter.service systemctl status node_exporter.service systemctl enable node_exporter.service
yum install httpd-tools -y htpasswd -nBC 12 '' | tr -d ':\n'
cat << EOF >/opt/node_exporter/config.yml basic_auth_users: prometheus: \$2y\$12\$hj1xMjOs1iH....... EOF
ps -ef|grep node_exporter systemctl stop node_exporter.service systemctl disable node_exporter.service systemctl daemon-reload rm -f /etc/systemd/system/node_exporter.service
|