一、zabbix监控nginx性能
1.安装nginx 服务
[root@server2 ~]# rpm -ivh nginx-1.8.0-1.el6.ngx.x86_64.rpm
warning: nginx-1.8.0-1.el6.ngx.x86_64.rpm: Header V4 RSA/SHA1 Signature, key ID 7bd9bf62: NOKEY
Preparing... ########################################### [100%]
1:nginx ########################################### [100%]
----------------------------------------------------------------------
Thanks for using nginx!
Please find the official documentation for nginx here:
* http://nginx.org/en/docs/
Commercial subscriptions for nginx are available on:
* http://nginx.com/products/
----------------------------------------------------------------------
2.编辑nginx的配置文件
[root@server2 ~]# cd /etc/nginx/conf.d/
[root@server2 conf.d]# ls
default.conf example_ssl.conf
[root@server2 conf.d]# vim default.conf
location /status {
stub_status on; # Nginx中的stub_status模块主要用于查看Nginx的一些状态信息. 本模块默认是不编译进Nginx,如果需要使用该模块,则要在编译安装Nginx时指定:./configure –with-http_stub_status_module
access_log off; # 关闭日志记录
}
[root@server2 conf.d]# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
[root@server2 conf.d]# nginx
[root@server2 conf.d]