1.简介 process-exporter主要用来做进程监控,比如某个服务的进程数、消耗了多少CPU、内存、IO资源等
2.安装配置
wget http://github.com/ncabatoff/process-exporter/releases/download/v0.7.2/process-exporter-0.7.2.linux-amd64.tar.gz
tar -xvf process-exporter-0.7.2.linux-amd64.tar.gz -C /usr/local/
cd /usr/local/
ln -s process-exporter-0.7.2.linux-amd64 process_exporter
cd process_exporter/
ln -s process-exporter process_exporter
mkdir logs
3.添加需要监控的进程配置(需要自己创建) 配置文件路径/usr/local/process_exporter/config.yaml
process_names:
- name: "{{.Matches}}"
cmdline:
- 'elasticsearch'
- name: "{{.Matches}}"
cmdline:
- 'logstash'
- name: "{{.Matches}}"
cmdline:
- 'kibana'
4.启动
nohup ./process-exporter -config.path="config.yaml" -web.listen-address=":9256">> logs/process-exporter.log 2>&1 &
#-config.path 指定进程配置文件
#-web.listen-address 指定监听端口
5.prometheus添加对应配置
- job_name: 'process'
static_configs:
- targets: ['106.75.x.x:9256']
6.grafana添加对应模板 最终展示