prometheus process-export进程监控
2022/8/23 5:24:00
本文主要是介绍prometheus process-export进程监控,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
- prometheus
- process-export
- 进程监控
一、环境部署,见
prometheus 邮件告警 第一节
https://blog.csdn.net/oToyix/article/details/120160633
二、process-export进程监控
1、process-export 下载、配置、启动
wget -c https://github.com/ncabatoff/process-exporter/releases/download/v0.7.5/process-exporter-0.7.5.linux-amd64.tar.gz tar -xf process-exporter-0.7.5.linux-amd64.tar.gz -C /usr/local/ cd /usr/local/ ln -s process-exporter-0.7.5.linux-amd64 process-exporter nohup ./process-exporter & firewall-cmd --add-port=9256/tcp --permanent firewall-cmd --reload cd process-exporter
进程配置文件
vim process-exporter.yaml process_names: - name: "{{.Matches}}" cmdline: - 'mysqld' - name: "{{.Matches}}" cmdline: - 'nginx' - name: "{{.Matches}}" cmdline: - 'php-fpm.conf'
启动
nohup /usr/local/process-exporter/process-exporter -config.path=/usr/local/process-exporter/process-exporter.yaml &
3、prometheus服务端配置
添加告警规则 之 文件发现
vim prometheus.yml
- job_name: "proess" file_sd_configs: - files: - targets/proess-*.yaml refresh_interval: 2m
cat targets/proess-all.yaml
- targets: - 192.168.0.63:9256 labels: app: node-process job: process
告警规则,当进程数为0时 告警
cat alert_rules/process_down.yaml
groups: - name: Allprocess rules: - alert: InproessDown expr: namedprocess_namegroup_num_procs == 0 for: 1m annotations: title: "process down" description: 'process has been down for more than 1 m .' labels: severity: 'critical'
----------------end
这篇关于prometheus process-export进程监控的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-29uni-app 中使用 Vant Weapp,怎么安装和配置npm ?-icode9专业技术文章分享
- 2024-12-27Nacos多环境配置学习入门
- 2024-12-27Nacos快速入门学习入门
- 2024-12-27Nacos快速入门学习入门
- 2024-12-27Nacos配置中心学习入门指南
- 2024-12-27Nacos配置中心学习入门
- 2024-12-27Nacos做项目隔离学习入门
- 2024-12-27Nacos做项目隔离学习入门
- 2024-12-27Nacos初识学习入门:轻松掌握服务发现与配置管理
- 2024-12-27Nacos初识学习入门:轻松掌握Nacos基础操作