合同会社BUSTERWORKS

合同会社BUSTERWORKS

ブログBLOG

CentOS7にZabbix3.4.15をインストールする

2019.3.1
IT

SELinux

\r\n

\r\n# getenforce\r\n# vi /etc/selinux/config\r\n

\r\n\r\n以下の通り編集\r\n

\r\n#SELINUX=enforcing\r\nSELINUX=disabled\r\n

\r\n\r\n

初期設定

\r\n

\r\n# hostnamectl set-hostname zbx.linode.example.com\r\n# yum -y update\r\n# reboot\r\n# yum -y install epel-release\r\n# yum -y install httpd-devel php php-devel php-pdo php-mysqlnd php-mbstring php-mcrypt php-gd php-pear php-pecl-apc-devel zlib-devel mariadb-devel mariadb-server\r\n

\r\n\r\n

Install Zabbix(1)

\r\n

\r\n# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm\r\n# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-web-japanese\r\n# yum -y install zabbix-agent\r\n

\r\n\r\n

MariaDB

\r\n

\r\n# systemctl start mariadb\r\n# systemctl enable mariadb\r\n# mysql -u root\r\n

\r\n\r\nMariaDBのコマンド\r\n

\r\ncreate database zabbix character set utf8 collate utf8_bin;\r\ngrant all on zabbix.* to zabbix@localhost identified by 'new-password';\r\nUPDATE mysql.user SET Password=PASSWORD('new-password') WHERE User='root';\r\nFLUSH PRIVILEGES;\r\nquit;\r\n

\r\n\r\n

Install Zabbix(2)

\r\n

\r\n# cd /usr/share/doc/zabbix-server-mysql-3.4.15/\r\n# zcat create.sql.gz | mysql -u zabbix -p new-password\r\n

\r\n\r\n

\r\n# vi /etc/zabbix/zabbix_server.conf\r\n

\r\n\r\n以下の通り編集\r\n

\r\n# DBPassword=\r\n↓\r\nDBPassword=new-password\r\n

\r\n\r\n

\r\n# vi /etc/httpd/conf.d/zabbix.conf\r\n

\r\n\r\n以下の通り編集\r\n

\r\n# php_value date.timezone Europe/Riga\r\n↓\r\nphp_value date.timezone Asia/Tokyo\r\n

\r\n\r\n

Start Zabbix

\r\n

\r\n# systemctl start zabbix-server\r\n# systemctl enable zabbix-server\r\n# systemctl start httpd\r\n# systemctl enable httpd\r\n

\r\n\r\n

起動確認

\r\nzabbix-serverが起動しているか確認\r\n

\r\n# systemctl status zabbix-server\r\n

\r\n\r\n

Firewalld

\r\n

\r\n# firewall-cmd --add-service=http --zone=public --permanent\r\n# firewall-cmd --reload\r\n

\r\n

TOPへ戻る