实验环境:新增一台主机node3
node1:172.25.7.1 | zabbix-agent zabbix-server |
node3:172.25.7.3 (新加的) | zabbix-agent nginx |
在node3上,下载安装zabbix-agen,nginx
一、node3安装zabbix-agent和nginx
[root@node3 ~]# yum install zabbix-agent-4.4.1-1.el7.x86_64.rpm -y
[root@node3 ~]# vim /etc/zabbix/zabbix_agentd.conf
98 Server=172.25.7.1
139 ServerActive=172.25.7.1
150 Hostname=node
[root@node3 ~]# systemctl restart zabbix-agent
[root@node3 ~]# tar zxf nginx-1.16.0.tar.gz
[root@node3 ~]# cd nginx-1.16.0
[root@node3 nginx-1.16.0]# ./configure --help
[root@node3 nginx-1.16.0]# yum install gcc zlib-devel pcre-devel -y #安装依赖行软件
[root@node3 nginx-1.16.0]#./configure --with-http_stub_status_module --prefix=/usr/local/nginx
[root@node3 nginx-1.16.0]#make && make install
root@node3 nginx-1.16.0]# cd /usr/local/nginx/
root@node3 nginx-1.16.0]# vim conf/nginx.conf
47 location /status {
48 stub_status on;
49 access_log off;
50 allow 127.0.0.1;
51 deny all;
52 }
root@node3 nginx-1.16.0]# sbin/nginx -t #检测有无错误
root@node3 nginx-1.16.0]# sbin/nginx #开启
root@node3 nginx-1.16.0]# netstat -antlupe #查看端口是否开启
root@node3 nginx-1.16.0]# curl http://127.0.0.1/status #测试是否部署成功
root@noroot@node3 nginx-1.16.0]#cd /etc/zabbix/zabbix_agentd.d/
root@node3 nginx-1.16.0]# vim userparameter_mysql.conf
root@node3 nginx-1.16.0]#mv userparameter_mysql.conf userparameter_nginx.conf
root@node3 nginx-1.16.0]#systemctl restart zabbix-agent
1 软件的安装
安装zabbix-agent
安装nginx所依赖性软件:
编译
安装:
2 配置文件的修改
修改zabbix-agent配置文件
重启zabbix服务:
修改nginx配置文件:[root@node3 nginx]# vim conf/nginx.conf
查看端口是否开启:
3 测试nginx服务,是否正常
修改nginx的监控项,把这个语句写入/etc/zabbix/zabbix_agentd.d/userparameter_mysql.conf里,写完可以改个名:userparameter_nginx.conf
写完后重启zabbix-agent服务
二、web界面添加nginx的监控
添加监控node3主机:
创建监控项:
创建图形:
点击预览:
三、更换字体
可以看到刚才的界面有不能识别的字符
在server :node1上添加字体simkai.ttf 即可,原本只有一个:
通过真机发送过去一个:
配置文件替换默认图形字体:
重启服务:systemctl restart zabbix-server
再次查看: