为了使Promethuse可以对进程进行监控,可以用利用process-exporter来检测所选进程的存活状态
一、安装process-exporter
- 1、安装部署
wget https://github.com/ncabatoff/process-exporter/releases/download/v0.6.0/process-exporter-0.6.0.linux-amd64.tar.gztar zxvf process-exporter-0.6.0.linux-amd64.tar.gzmv process-exporter-0.6.0.linux-amd64 /usr/local/exporter/process-exporter
- 2、配置文件,监控特定进程 vi /usr/local/exporter/process-exporter/process-exporter.yaml
process_names: - name: "{
{.Matches}}" cmdline: - 'redis-server' - name: "{
{.Matches}}" cmdline: - 'mysqld' - name: "{
{.ExeFull}}" cmdline: - '/usr/bin/mongod -f /etc/mongod.conf' - name: "{
{.Matches}}" cmdline: - 'org.apache.zookeeper.s