本文共 2918 字,大约阅读时间需要 9 分钟。
Download and install Zabbix
yum install mariadb-server mariadb –ysystemctl enable mariadbsystemctl restart mariadb
rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm yum install zabbix-server-mysql zabbix-web-mysql -y
mysqlMariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;Query OK, 1 row affected (0.00 sec)MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';Query OK, 0 rows affected (0.08 sec)MariaDB [(none)]> exitBye
zcat /usr/share/doc/zabbix-server-mysql-3.4.8/create.sql.gz |mysql -uzabbix -pzabbix zabb
注意:/usr/share/doc/zabbix-server-mysql-xxx 以实际安装的版本为准
vim /etc/zabbix/zabbix_server.conf124 # Default:125 DBPassword=zabbix
systemctl enable zabbix-serversystemctl start zabbix-server
编辑Zabbix前端PHP配置,更改时区
vim /etc/httpd/conf.d/zabbix.confphp_value date.timezone Asia/Shanghai
systemctl enable httpdsystemctl start httpd
浏览器访问,并进行安装
默认用户Admin 默认密码zabbix
yum install zabbix-agent –y
vim /etc/zabbix/zabbix_agentd.conf修改IP地址server IP地址97 Server=10.10.10.16138 ServerActive=10.10.10.16
systemctl enable zabbix-agent.servicesystemctl restart zabbix-agent.service
LogFile=c:\zabbix\zabbix_agentd.log
Server=10.10.10.16ServerActive=10.10.10.16Hostname=Windows_A参数说明:
Server: zabbix server的ip地址,
ServerActive: zabbix 主动监控server的ip地址,其中Server和ServerActive都指定zabbix Server的IP地址,不同的是,前者是被动后者是主动。也就是说Server这个配置是用来允许172.17.22.155这个ip来我这取数据。而ServerActive的172.17.22.155的意思是,客户端主动提交数据给他。Hostname 主机名,必须唯一,区分大小写。Hostname必须和zabbix web上配置的一直,否则zabbix主动监控无法正常工作。因为agent拿着这个主机名去问server,我有配置主动监控项吗?server拿着这个主机名去配置里面查询,然后返回信息。zabbix agent检测分为主动(agent active)和被动(agent)两种形式,主动与被动的说法均是相对于agent来讨论的。主动:agent请求server获取主动的监控项列表,并主动将监控项内需要检测的数据提交给server/proxy被动:server向agent请求获取监控项的数据,agent返回数据。修改好文件后,用CMD(需有管理员权限)将Zabbix Agent安装为Windows系统的服务,在windows控制台下执行以下命令:
c:\zabbix\bin\win64\zabbix_agentd.exe -i -c c:\zabbix\conf\zabbix_agentd.win.conf
zabbix_agentd.exe [492]: service [Zabbix Agent] installed successfully
zabbix_agentd.exe [492]: event source [Zabbix Agent] installed successfulc:\zabbix\bin\win64\zabbix_agentd.exe -c c:\zabbix\conf\zabbix_agentd.win.conf -s
控制台信息zabbix_agentd.exe [2490]: service [Zabbix Agent] started successfully查看Windows端口使用
PS C:\Users\Administrator> netstat -ano|findstr "10050"
TCP 0.0.0.0:10050 0.0.0.0:0 LISTENING 1836TCP [::]:10050 [::]:0 LISTENING 1836PS C:\Users\Administrator> tasklist|findstr "1836"zabbix_agentd.exe 1836 Services 0 8,540 KPS C:\Users\Administrator>查看启动的日志zabbix_agentd.log:
c:\zabbix\zabbix_agentd.log参考:
转载于:https://blog.51cto.com/2168836/2113244