CentOS 8.x Zabbix installation

From Notes_Wiki
Revision as of 06:38, 12 January 2021 by Saurabh (talk | contribs) (Created page with "<yambe:breadcrumb self="Zabbix installation">CentOS 8.x Zabbix|Zabbix</yambe:breadcrumb> =CentOS 8.x Zabbix installation= To install Zabbix on centOS 8 use: # Disable SELinux...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

<yambe:breadcrumb self="Zabbix installation">CentOS 8.x Zabbix|Zabbix</yambe:breadcrumb>

CentOS 8.x Zabbix installation

To install Zabbix on centOS 8 use:

  1. Disable SELinux (setenforce 0, /etc/sysconfig/selinux: SELINUX=disabled)
  2. Install required web server with php and database
    dnf install -y httpd mariadb-server php php-cli php-common php-mbstring php-mysqlnd php-xml php-bcmath php-devel php-pear php-gd
  3. Edit following php configuration values:
    memory_limit 256M
    upload_max_filesize 16M
    post_max_size 16M
    max_execution_time 300
    max_input_time 300
    max_input_vars 10000
    date.timezone = Asia/Kolkata
  4. Start and enable various services
    <pre>
    systemctl start httpd
    systemctl start mariadb
    systemctl enable httpd
    systemctl enable mariadb
  5. Lock MySQL installation using:
    mysql_secure_installation
    There is no existing mysql password, set new password and accept (Y) default for all other queries
  6. Create DB for zabbix using:
    1. Start mysql client
      mysql -u root -p
    2. Create user and database
      CREATE DATABASE zabbix CHARACTER SET utf8 collate utf8_bin;
      GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY '<secret-zabbix-db-password>';
      flush privileges;
      exit;
  7. Install libssh2
    yum -y install epel-release
    yum -y install libssh2
  8. Install Zabbix repository based on latest compatible version from http://repo.zabbix.com/zabbix/5.2/rhel/8/x86_64/
    dnf install -y rpm -Uvh https://repo.zabbix.com/zabbix/5.2/rhel/8/x86_64/zabbix-release-5.2-1.el8.noarch.rpm
  9. Install zabbix server and agent
    dnf install -y zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-apache-conf
  10. Start and enable zabbix processes
    systemctl restart zabbix-server zabbix-agent httpd php-fpm
    systemctl enable zabbix-server zabbix-agent httpd php-fpm
  11. Initialize Zabbix DB
    cd /usr/share/doc/zabbix-server-mysql
    zcat create.sql.gz | mysql -u zabbix -p zabbix
    Enter <secret-zabbix-db-password> specified while creating zabbix user
  12. Edit /etc/zabbix/zabbix_server.conf and specify DBpassword
    DBPassword=<secret-zabbix-db-password>
    Enter <secret-zabbix-db-password> specified while creating zabbix user
  13. Configure timezone for Zabbix in PHP by editing /etc/php-fpm.d/zabbix.conf
    php_value[date.timezone] = Asia/Kolkata
  14. Restart various processes
    systemctl restart zabbix-server
    systemctl restart zabbix-agent
    systemctl restart php-fpm
    systemctl restart httpd
    systemctl restart mariadb
  15. Configure firewall rules for Zabbix
    firewall-cmd --permanent --add-service=http
    firewall-cmd --permanent --add-port=10050/tcp
    firewall-cmd --permanent --add-port=10051/tcp
    firewall-cmd --reload
  16. Access Zabbix UI at http://<server-fqdn-or-ip>/zabbix/
    Leave most settings default except DB-password <secret-zabbix-db-password> and desired Name for Zabbix server
  17. Login with Admin/zabbix


Refer:


<yambe:breadcrumb self="Zabbix installation">CentOS 8.x Zabbix|Zabbix</yambe:breadcrumb>