Prometheus笔记-监控Nginx

安装Nginx及stub_status模块

参考历史文章:https://www.cnblogs.com/jruing/p/17391716.html

安装Nginx-exporter

# 下载
wget https://github.com/nginxinc/nginx-prometheus-exporter/releases/download/v0.11.0/nginx-prometheus-exporter_0.11.0_linux_amd64.tar.gz
# 解压
tar -zxvf nginx-prometheus-exporter_0.11.0_linux_amd64.tar.gz
# 启动
cd  nginx-prometheus-exporter
./nginx-prometheus-exporter -nginx.scrape-uri=http://192.168.137.10:80/stub_status //这里需要改成自己的地址

修改Prometheus配置文件

scrape_configs:
  - job_name: 'nginx'
    scrape_interval: 10s
    static_configs:
      - targets: ['192.168.137.10:9113']

Nginx-exporter预览地址

http://192.168.137.10:9113/

image-20230518170318381

Prometheus展示页面

http://192.168.137.10:9090/targets?search=

image-20230518170339245

posted @ 2023-05-18 17:05  Jruing  阅读(145)  评论(0编辑  收藏  举报