Difference between revisions of "CentOS 8.x Zabbix installation"

From Notes_Wiki
m
m
Line 40: Line 40:
# Install Zabbix repository based on latest compatible version from http://repo.zabbix.com/zabbix/5.2/rhel/8/x86_64/
# Install Zabbix repository based on latest compatible version from http://repo.zabbix.com/zabbix/5.2/rhel/8/x86_64/
#:<pre>
#:<pre>
#:: dnf install -y rpm -Uvh https://repo.zabbix.com/zabbix/5.2/rhel/8/x86_64/zabbix-release-5.2-1.el8.noarch.rpm
#:: dnf install -y https://repo.zabbix.com/zabbix/5.2/rhel/8/x86_64/zabbix-release-5.2-1.el8.noarch.rpm
#:</pre>
#:</pre>
# Install zabbix server and agent
# Install zabbix server and agent

Revision as of 04:58, 21 February 2023

Home > CentOS > CentOS 8.x > CentOS 8.x monitoring > CentOS 8.x Zabbix > 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 php configuration as per Rocky 9.x Increase default PHP resources
    Optionally enable server concurrency as per Rocky 9.x Configure apache web server for concurrency
  4. Start and enable various services
    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 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:


Home > CentOS > CentOS 8.x > CentOS 8.x monitoring > CentOS 8.x Zabbix > CentOS 8.x Zabbix installation