- 版本:node_exporter-1.5.0
- 安装步骤
cd /usr/local
mkdir node_exporter
tar -zxvf node_exporter-1.5.0.linux-amd64.tar.gz --strip-components 1 -C node_exporter
- 将node_exporter配置为系统服务
cd /usr/lib/systemd/system
vim node_exporter.service
[Unit]
Description=node_exporter
After=network.target
[Service]
ExecStart=/usr/local/node_exporter/node_exporter
--web.listen-address=:9100\
--collector.systemd\
--collector.systemd.unit-whitelist=(sshd|nginx).service\
--collector.processes\
--collector.tcpstat
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable node_exporter
systemctl restart node_exporter
- 添加prometheus监控配置并重启
cd /usr/local/prometheus
vim prometheus.yml
- job_name: 'linux'
static_configs:
- targets: ['10.15.111.15:9100']
labels:
instance: '10.15.111.15:9100-linx'
systemctl restart prometheus
- 验证