nginx编译使用
在server2上进行
tar zxf nginx-1.20.1.tar.gz
cd nginx-1.20.1
安装编译依赖
yum install gcc -y
yum install -y pcre-devel
yum install -y openssl-devel.x86_64
关闭c语言编译debug
vim ~/nginx-1.20.1/auto/cc/gcc
指定编译路径及功能模块
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module
执行make
make
执行make install
创建nginx用户,建立软连接,运行nginx
cd /usr/local/nginx/
ln -s /usr/local/nginx/sbin/nginx /usr/local/bin/
配置文件修改vim /usr/local/nginx/conf/nginx.conf
检测语句是否正确nginx -t
启动服务nginx
查看
编写一个nginx脚本,通过agent获取信息
把刚才在shell测试的抓取指令写进去
重启agentsystemctl restart zabbix-agent.service
在server1上进行
安装zabbix-get
get键值
zabbix_get -s 172.25.30.1 -p 10050 -k "nginx.handle"
添加监控项,键值必须与userparameter_nginx.conf对应
创建图形