标签:rest ocs conf eth https down com pre 参考
cd /usr/src/
wget https://github.com/prometheus/prometheus/releases/download/v2.12.0/prometheus-2.12.0.linux-amd64.tar.gz
tar xf prometheus-2.12.0.linux-amd64.tar.gz -C /usr/local/
cd /usr/local/
ln -s prometheus-2.12.0.linux-amd64 prometheus
cat > /usr/lib/systemd/system/prometheus.service << EOF
[Unit]
Description=Prometheus: the monitoring system
Documentation=http://prometheus.io/docs/
[Service]
ExecStart=/usr/local/prometheus/prometheus --config.file=/usr/local/prometheus/prometheus.yml
Restart=always
StartLimitInterval=0
RestartSec=10
[Install]
WantedBy=multi-user.target
EOF
systemctl enable prometheus ##制作开机启动prometheus
systemctl start prometheus ##启动prometheus
systemctl status prometheus ##查看promethus状态
cd /usr/src/
wget https://github.com/prometheus/node_exporter/releases/download/v0.18.1/node_exporter-0.18.1.linux-amd64.tar.gz
tar xf node_exporter-0.18.1.linux-amd64.tar.gz -C /usr/local/
cd /usr/local/
ln -s node_exporter-0.18.1.linux-amd64 node_exporter
cat > /usr/lib/systemd/system/node_exporter.service << EOF
[Unit]
Description=Prometheus node exporter
After=local-fs.target network-online.target network.target
Wants=local-fs.target network-online.target network.target
[Service]
Restart=on-failure
ExecStart="/usr/local/node_exporter/node_exporter"
[Install]
WantedBy=multi-user.target
EOF
systemctl enable node_exporter.service ##制作开机启动node_exporter
systemctl start node_exporter.service ##启动node_exporter
systemctl status node_exporter.service ##查看node_exporter状态
http://localhost:9090
curl http://localhost:9090/metrics
标签:rest ocs conf eth https down com pre 参考
原文地址:https://www.cnblogs.com/sxgaofeng/p/12408601.html