1.下载二进制文件process-exporter
项目地址:https://github.com/ncabatoff/process-exporter
下载地址:https://github.com/ncabatoff/process-exporter/releases/download/
2.启动
#解压
tar -zxvf process-exporter-0.8.2.linux-amd64.tar.gz mkdir /usr/local/node_exporter/ mv process-exporter-0.8.2.linux-amd64/process_exporter /usr/local/node_exporter/process_exporter
#编辑配置文件
vim /usr/local/node_exporter/conf/process.yml process_names: - name: "{{.Matches}}" cmdline: - 'tomcat' #唯一标识 - name: "{{.Matches}}" cmdline: - '9500' #唯一标识
#创建systemd
vim /etc/systemd/system/process_exporter.service [Unit] Description=process_exporter After=network.target [Service] Type=simple ExecStart=/usr/local/node_exporter/process_exporter -config.path=/usr/local/node_exporter/conf/process.yml Restart=on-failure [Install] WantedBy=multi-user.target
启动进程
systemctl daemon-reload systemctl start process_exporter systemctl enable process_exporter
标签:node,exporter,process,prometheus,systemctl,usr,local From: https://www.cnblogs.com/xiaoxiaomuyuyu/p/18252060