Zabbix下载及安装前准备
zabbix官网:https://www.zabbix.com/
zabbix下载页面:https://www.zabbix.com/download
zabbix rpm包下载页面:http://repo.zabbix.com/zabbix/
环境说明:
操作系统: centOS7
MySQL版本: Server version: 8.0.11 MySQL Community Server
Zabbix版本: 4.0
MySQL已经安装,这里Zabbix和MySQL安装在同一个操作系统下。
安装之前准备:
修改主机名为: zabbix_ser
setenforce 0 #关闭selinux
systemctl stop firewalld.service # 临时关闭防火墙
systemctl disable firewalld.service # 永久关闭防火墙
reboot重启主机
zabbix安装
登陆zabbix下载页面:https://www.zabbix.com/download
选择要安装的zabbix版本,我这里选择4.0,和操作系统,及数据库MySQL等,如上图.则会生成安装命令,按照安装命令操作即可:
Install and configure Zabbix server for your platform
a. Install Zabbix repository
# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-2.el7.noarch.rpm
# yum clean all
b. Install Zabbix server, frontend, agent
# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent
c. Create initial database
Make sure you have database server up and running. 我已经安装过MySQL8
Run the following on your database host.
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
因为是mysql8,所以这里我加了
mysql_native_password选项,命令为:
mysql>CREATE USER zabbix@localhost identified WITH mysql_native_password by 'Test@123';mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
On Zabbix server host import initial schema and data. You will be prompted to enter your newly created password.
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
输入密码: Test@123
d. Configure the database for Zabbix server
Edit file /etc/zabbix/zabbix_server.conf
DBPassword=
Test@123
e. Configure PHP for Zabbix frontend
Edit file /etc/httpd/conf.d/zabbix.conf, uncomment and set the right timezone for you.
# php_value date.timezone
Asia/Shanghai
f. Start Zabbix server and agent processes
Start Zabbix server and agent processes and make it start at system boot.
# systemctl restart zabbix-server zabbix-agent httpd
# systemctl enable zabbix-server zabbix-agent httpd
g. Configure Zabbix frontend
Connect to your newly installed Zabbix frontend: http://server_ip_or_name/zabbix
Follow steps described in Zabbix documentation: Installing frontend
登陆: http://192.168.116.131/zabbix
点finish完成,然后用户名密码Admin/zabbix登陆,如图: