在CentOS7上安装Zabbix4.0
Zabbix:扎比克斯
因为Zabbix的官方文档并没有完整地解释安装方法,所以我将在此记录下目前的安装方法。
首先
我从来没有使用过Zabbix,但是因为2018年10月发布了4.0版本,所以我想试试看。
關閉SELinux
vi /etc/selinux/config
SELINUX=disabled
reboot
重新启动
reboot
安装Zabbix
基本上按照官方文件的指示进行操作。
然后,也要查看这边的官方网站等相关资料。
Zabbix服务器安装
rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
yum -y install yum-utils
因为无法使用,所以需要安装上方的内容(官方文件中未提及)。
yum-config-manager --enable rhel-7-server-optional-rpms
yum -y install zabbix-server-mysql zabbix-proxy-mysql zabbix-web-mysql zabbix-agent
安装数据库。
yum install mariadb mariadb-server
Installed:
mariadb.x86_64 1:5.5.60-1.el7_5 mariadb-server.x86_64 1:5.5.60-1.el7_5
systemctl enable mariadb.service
systemctl start mariadb.service
#設定
mysql_secure_installation
Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:なんか適当に
Re-enter new password:なんか適当に
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] n
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y
mysql -uroot -p
Enter password:
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.01 sec)
grant all privileges on zabbix.* to zabbix@localhost identified by 'password'; -- なんか適当にパスワード
MariaDB [(none)]> quit;
Bye
导入初始数据和模式
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Enter password: # 上記のパスワード
进行Zabbix服务器的数据库设置
vi /etc/zabbix/zabbix_server.conf
DBPassword= #上記のパスワードを入力
设置Zabbix前端的时区。
/etc/httpd/conf.d/zabbix.conf
↓をよしなに変更
php_value date.timezone Asia/Tokyo
重启Zabbix服务器
systemctl restart zabbix-server httpd zabbix-agent
systemctl enable zabbix-server httpd zabbix-agent
进行Zabbix访问







