zabbix 3.0.4 Nginx 性能监控

时间:2024-11-01 09:33:38

搭建Nginx

安装pcre-devel 、zlib-devel支持包

[root@test /]# yum -y install pcre-devel zlib-devel

创建nginx用户

[root@test /]# useradd -M -s /sbin/nologin nginx

解压安装

[root@test /]# tar zxvf nginx-1.6..tar.gz
[root@test /]# cd nginx-1.6.
[root@test nginx-1.6.0]# ./configure --prefix=/usr/local/nginx --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre
[root@test nginx-1.6.0]# make && make install

优化执行路径

[root@test nginx-1.6.]# ln -s /usr/local/nginx/sbin/* /usr/local/sbin/

在zabbix agentd客户端上,查看nginx是否加载了--with-http_stub_status_module。zabbix监控根据nginx的stub status 模块,抓取所提供的数据

检查with-http_stub_status_module有没有安装

[root@test nginx-1.6.]# /usr/local/sbin/nginx -V
nginx version: nginx/1.6.
built by gcc 4.4. (Red Hat 4.4.-) (GCC)
configure arguments: --prefix=/usr/local/nginx --with-http_realip_module --with-http_sub_module --with-http_gzip_static_module --with-http_stub_status_module --with-pcre