将ZabbixServer4.0安装到RHEL7.6中
环境
-
Red Hat Enterprise Linux Server release 7.6 (Maipo)
zabbix-server-mysql-4.0.3-1.el7.x86_64
请参考
使用从软件包安装的方式来安装 RHEL 或 CentOS。
安装
Zabbix服务器 + 前端
# zabbix repositoryの追加
rpm -ivh https://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm
# php周りの依存関係解消の為optionalリポジトリを有効化(zabbix-web-mysqlで使用)
yum-config-manager --enable rhui-REGION-rhel-server-optional
# zabbix server(mysql) install
yum install zabbix-server-mysql
# zabbix frontend install(ここでhttpdも入る)
yum install zabbix-web-mysql zabbix-web-japanese
Mariadb的安装和初始设置
# mariadbのistall
yum install mariadb-server
# mariadbの起動
systemctl start mariadb && systemctl status mariadb
systemctl enable mariadb
# mysql_secure_installationの実行
mysql_secure_installation
#
Set root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y
# zabbix用databaseとユーザの作成
zabbix_pass=xxxxxxxx
# zabbix server
mysql -uroot -e "create database zabbix character set utf8 collate utf8_bin;"
mysql -uroot -e "grant all privileges on zabbix.* to zabbix@localhost identified by '$zabbix_pass';"
安装zabbix数据库
# create.sqlの実行(zabbix server)
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
# DBHost=localhost、DBName=zabbix、DBUser=zabbixはそのまま利用。パスワードのみ設定する
# zabbix server
sed -i "s/# DBPassword=/# DBPassword=\nDBPassword=$zabbix_pass/g" /etc/zabbix/zabbix_server.conf
启动Zabbix服务器
# 起動
systemctl start zabbix-server && systemctl status zabbix-server
# 自動起動も有効化しておく
systemctl enable zabbix-server
httpd的配置
# zabbix.conf内のphpの変数”date.timezone"修正
# php_value date.timezone Europe/Rigaをphp_value date.timezone Asia/Tokyoに変更
# httpd の起動
systemctl start httpd && systemctl status httpd
# 自動起動設定
systemctl enable httpd
从Zabbix Web UI进行设置。
只需要一个选项,请将以下内容用中文进行本地化改写:
・ 访问http://{zabbix-server的IP}/zabbix。

・环境的预先检查





