配置
在客户端上面安装nginx
yum install nginx-1.8.0-1.el6.ngx.x86_64.rpm -y
cd /etc/nginx/conf.d
vim default.conf
13 location /status {
14 stub_status on;
15 access_log off;
16 allow 127.0.0.1;
17 deny all;
18 }
cd /etc/zabbix/zabbix_agentd.d/
cp userparameter_mysql.conf userparameter_nginx.conf
vim userparameter_nginx.conf #这个文件分别取下图中的值
UserParameter=nginx.active,curl -s http://127.0.0.1/status |grep Active |awk '{print $3}'
UserParameter=nginx.accepts,curl -s http://127.0.0.1/status | awk NR==3 |awk '{print $1}'
UserParameter=nginx.handled,curl -s http://127.0.0.1/status | awk NR==3 |awk '{print $2}'
UserParameter=nginx.requests,curl -s http://127.0.0.1/status | awk NR==3 |awk '{print $3}'
服务端配置
systemctl restart zabbix-agent
systemctl start mariadb
systemctl enable mariadb
systemctl start zabbix-server
systemctl enable zabbix-server
chkconfig zabbix-agent on
rpm -ivh zabbix-get-3.4.6-1.el7.x86_64.rpm
zabbix_get -s 172.25.12.1 -p 10050 -k 'nginx.active'
systemctl start httpd
systemctl enable httpd
可以通过这个命令来检测键值是否可以正确读取
在服务端创建监控项
将键值逐个添加进去
创建图形