prometheus监控主机
生活随笔
收集整理的這篇文章主要介紹了
prometheus监控主机
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
上篇文章我們在IP:10.0.0.17上部署好了Prometheus,這篇文章我們在IP:10.0.0.18上安裝node_exporter,用Prometheus來監控遠端的主機。
1.node_exporter軟件下載
1.官網地址:https://prometheus.io/download/
2.選擇node_exporter然后下載
2.安裝node組件
在被監控端agent上安裝node_exporter組件,這樣prometheus就可以接收到被監控端的數據了
1.上傳軟件包到Linux服務器上(agent被監控端)
2.解壓node_exporter組件
tar xf node_exporter-1.3.0.linux-amd64.tar.gz -C /usr/local/
3.創建軟連接,以后如果版本需要升級,重新指定源文件即可。
cd /usr/local/
ln -sv node_exporter-1.3.0.linux-amd64 node_exporter
3.啟動node_exporter
1.后臺啟動node_exporter
nohup /usr/local/node_exporter/node_exporter &
2.查看端口信息
netstat -tunlp |grep 9100
通過瀏覽器訪問:IP/meterics ------> http://10.0.0.18:9100/metrics
4.讓prometheus拉取node節點信息
Prometheus服務器的配置文件里添加被監控機器配置
IP:10.0.0.17上操作
1.在prometheus配置文件添加,如下3行信息
[root@prometheus-17 ~]# tail -3 /usr/local/prometheus/etc/prometheus.yml
- job_name: 'agent'
static_configs:
- targets: ['10.0.0.18:9100']
2.設置完成之后重啟Prometheus
systemctl restart prometheus.service
systemctl status prometheus.service
5.查看主機是否被監控到
瀏覽器訪問IP:9090
總結
以上是生活随笔為你收集整理的prometheus监控主机的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 在 SAP BTP Kyma Runti
- 下一篇: Angular Schematics 学