目录
2,在Linux安装 nginx-module-vts 组件 下载地址
3,在Linux安装nginx-vts-exporter 组件 下载地址
二,安装nginx以及组件 nginx-module-vts
4,启动nginx后访问http://IP地址/status
1,安装 nginx-vts-exporter 用来收集 nginx 的 json 数据
四,添加监控至 Prometheus服务器IP地址(192.168.100.12)
通过上一篇文章,(一)Prometheus部署+node_exporter组件实例详解
本篇继续搭建基于——Prometheus监控Nginx服务
一,部署环境准备
| Prometheus服务器 | 192.168.100.12 |
| Nginx+MySQL服务器 | 192.168.100.13 |
| grafana 服务器 | 192.168.100.12 |
1,安装Nginx 下载地址
https://nginx.org/download/nginx-1.22.1.tar.gz
2,在Linux安装 nginx-module-vts 组件 下载地址
nginx-module-vts组件: Nginx的监控模块,能够提供JSON格式的数据产出
https://codeload.github.com/vozlt/nginx-module-vts/zip/refs/heads/master
3,在Linux安装nginx-vts-exporter 组件 下载地址
nginx-vts-exporter 组件:主要用于收集Nginx的监控数据,并给Prometheus提供监控接口,默认端口号9913
https://github.com/hnlq715/nginx-vts-exporter/releases/download/v0.10.3/nginx-vts-exporter-0.10.3.linux-amd64.tar.gz
二,安装nginx以及组件 nginx-module-vts
1,安装Nginx
[root@localhost ~]# cd /opt/ ; mkdir nginx ; cd nginx
[root@localhost nginx]# pwd
/opt/nginx
[root@localhost nginx]# rz -E
rz waiting to receive.
[root@localhost nginx]# ls
nginx-1.22.1.tar.gz
[root@localhost nginx]# tar xf nginx-1.22.1.tar.gz #解压包
[root@localhost nginx]# ls
nginx-1.22.1 nginx-1.22.1.tar.gz
#安装依赖
[root@localhost nginx]# yum -y install openssl-devel pcre-devel
#上传解压组件
[root@localhost nginx]# rz -E
rz waiting to receive.
[root@localhost nginx]# ls
nginx-1.22.1 nginx-1.22.1.tar.gz nginx-module-vts-master.zip
[root@localhost nginx]# unzip nginx-module-vts-master.zip
[root@localhost nginx]# ls
nginx-1.22.1 nginx-1.22.1.tar.gz nginx-module-vts-master nginx-module-vts-master.zip
[root@localhost nginx]# mv nginx-module-vts-master /usr/local/
[root@localhost nginx]# cd nginx-1.22.1/
[root@localhost nginx-1.22.1]# ls
auto CHANGES CHANGES.ru conf configure contrib html LICENSE man README src
编译安装Nginx
[root@localhost nginx-1.22.1]# ./configure --prefix=/usr/local/nginx --add-module=/usr/local/nginx-module-vts-master/
checking for OS
+ Linux 3.10.0-1160.71.1.el7.x86_64 x86_64
checking for C compiler ... found
+ using GNU C compiler
+ gcc version: 4.8.5 20150623 (Red Hat 4.8.5-44) (GCC)
checking for gcc -pipe switch ... found
checking for -Wl,-E switch ... found
checking for gcc builtin atomic operations ... found
checking for C99 variadic macros ... found
checking for gcc variadic macros ... found
checking for gcc builtin 64 bit byteswap ... found
checking for unistd.h ... found
checking for inttypes.h ... found
checking for limits.h ... found
checking for sys/filio.h ... not found
checking for sys/param.h ... found
checking for sys/mount.h ... found
checking for sys/statvfs.h ... found

Prometheus监控Nginx服务&spm=1001.2101.3001.5002&articleId=129816580&d=1&t=3&u=9c97adabf3224509a85888e33b1caf6a)
1699

被折叠的 条评论
为什么被折叠?



