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

作者:jruing

出处:https://www.cnblogs.com/jruing/p/17412523.html

版权:本作品采用「署名-非商业性使用-相同方式共享 4.0 国际」许可协议进行许可。

posted @   Jruing  阅读(166)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
· 张高兴的大模型开发实战:(一)使用 Selenium 进行网页爬虫
more_horiz
keyboard_arrow_up light_mode palette
选择主题
menu
点击右上角即可分享
微信分享提示