環境
- Red Hat Enterprise Linux Server release 7.6 (Maipo)
- zabbix-server-mysql-4.0.3-1.el7.x86_64
参考
nstall_from_packages rhel_centos
install
zabbix server + frontend
# 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のinstallと初期設定
# 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 databaseのsetup
# 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 serverの起動
# 起動
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 Webuiからの設定
・ http://{zabbix-serverのip}/zabbixにアクセス
・環境の事前チェック