CentOS 7下Nginx安装配置nginx-module-exporter 数据采集器 - 灰信网(软件开发博客聚合)


一、下载当前最新版本的软件包:

wget -c https://github.com/hnlq715/nginx-vts-exporter/releases/download/v0.10.3/nginx-vts-exporter-0.10.3.linux-amd64.tar.gz 

二、解压并运行

解压:

tar -zxvf nginx-vts-exporter-0.10.3.linux-amd64.tar.gz 

进入解压后的目录:

cd nginx-vts-exporter-0.10.3.linux-amd64/

后台运行nginx-module-exporter 数据采集器:

 nohup ./nginx-vts-exporter -nginx.scrape_uri=http://localhost/status/format/json& 

推荐exporter和nginx安装在同一台机器上,如果不在同一台主机,把scrape_uri改为nginx主机的地址。

三、访问测试

nginx_vts_exporter的默认端口号:9913,对外暴露监控接口http://xxx:9913/metrics.
浏览器访问地址:

 http://192.168.77.135:9913/metrics

页面访问效果:

注:监控采集指标说明: nginx_server_bytes:统计nginx进出的字节计数可以精确到每个host,in进,out出


adouk 2023年1月10日 15:57 收藏文档