监控linux主机的相关性能 cpu 内存 网络 磁盘 带宽 IO
采用插件node_export
部署node_exporter插件
[root@node1 ~]# mkdir /opt/monitor/
[root@node1 ~]# tar -xf node_exporter-0.17.0.linux-amd64.tar.gz -C /opt/monitor/
[root@node1 ~]# cd /opt/monitor/
[root@node1 monitor]# mv node_exporter-0.17.0.linux-amd64/ node_exporter/
[root@node1 monitor]# cd /usr/lib/systemd/system
[root@node1 system]# cat node_exporter.service
[Unit]
Description=node_exporter
[Service]
ExecStart=/usr/local/node_exporter/node_exporter --
web.config=/usr/local/node_exporter/config.yml
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=on-failure
[Install]
WantedBy=multi-user.target
[root@node1 system]# systemctl restart node_exporter
[root@node1 system]# ps -ef | grep node_exporter
root 74601 1 0 09:06 ? 00:00:00 /usr/local/node_exporter/node_exporter --
root 74665 73020 0 09:06 pts/1 00:00:00 grep --color=auto node_exporter
[root@node1 system]# ss -anptu | grep node_exporter
tcp LISTEN 0 128 :::9100 :::* users:(("node_exporter",pid=74601,fd=3))
prometheus service端的配置
在promenteus.yml文件当中添加
- job_name: 'node_exporter'
static_configs:
- targets: ['192.168.0.61:9100']
重启服务
systemctl restart prometheus