{"id":12745,"date":"2022-05-14T14:54:58","date_gmt":"2022-05-14T11:54:58","guid":{"rendered":"https:\/\/kifarunix.com\/?p=12745"},"modified":"2024-03-09T13:38:26","modified_gmt":"2024-03-09T10:38:26","slug":"install-zabbix-server-on-rocky-linux","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-zabbix-server-on-rocky-linux\/","title":{"rendered":"Install Zabbix Server on Rocky Linux"},"content":{"rendered":"\n
In this guide, we are going to learn how to install Zabbix server on Rocky Linux. Zabbix<\/a> is an enterprise class monitoring solution for any kind of IT infrastructure, services, applications, cloud resources.<\/p>\n\n\n\n Zabbix can be built from the source code or can be installed from Zabbix repository.<\/p>\n\n\n\n In this guide, we will install Zabbix server via the Zabbix Rocky Linux repositories<\/a>.<\/p>\n\n\n\n Thus, run the command below to install Zabbix Rocky Linux repositories;<\/p>\n\n\n\n Zabbix is a PHP based app. Thus, we will use PHP 7.4 in this guide.<\/p>\n\n\n\n To be able to install Zabbix with PHP 7.4 on Rocky Linux, enable PHP 7.4 modules;<\/p>\n\n\n\n Next, install Zabbix Server and other required Zabbix packages on Rocky Linux;<\/p>\n\n\n\n Sample command output;<\/p>\n\n\n\n Install MySQL 8 on Rocky Linux;<\/p>\n\n\n\n Start MySQL service;<\/p>\n\n\n\n Run MySQL secure install script;<\/p>\n\n\n\n Login to MariaDB server and create a database and a database user for Zabbix. The database user should have all the privileges on the zabbix database.<\/p>\n\n\n\n To begin with, configure Zabbix database connection details.<\/p>\n\n\n\n Open the configuration file, Import initial Zabbix database schema and data to the newly create database.<\/p>\n\n\n\n Restart and enable Zabbix server, agent deamon to run on system start.<\/p>\n\n\n\n If firewall is running, open TCP port 10051 and HTTP\/HTTPS for remote connection.<\/p>\n\n\n\n To complete Zabbix installation, navigate to the browser and access your Zabbix server via the address http:\/\/<server-IP>\/zabbix<\/strong>.<\/p>\n\n\n\n When access the address above, the first page you land on is Zabbix welcome page.<\/p>\n\n\n\n Click Next Step to verify if all the Zabbix requirements have been met.<\/p>\n\n\n\n Configure Zabbix database connection using the connection details set before.<\/p>\n\n\n\n Setup the Zabbix server details.<\/p>\n\n\n\n On the Pre-installation summary, verify if all the configurations are fine.<\/p>\n\n\n\n If all is well, click Next step to finish the installation. If all is well, you should see Zabbix installation congratulatory message.<\/p>\n\n\n\n You have successfully setup Zabbix Frontend. Click Finish<\/strong> to get to Zabbix login interface.<\/p>\n\n\n\n The default login credentials are:<\/p>\n\n\n\n When you successfully login to Zabbix, you should land on the default dashboard.<\/p>\n\n\n\nInstall Zabbix Server on Rocky Linux<\/h2>\n\n\n\n
dnf install https:\/\/repo.zabbix.com\/zabbix\/6.0\/rhel\/8\/x86_64\/zabbix-release-6.0-1.el8.noarch.rpm<\/code><\/pre>\n\n\n\n
dnf module -y reset php<\/code><\/pre>\n\n\n\n
dnf module -y enable php:7.4<\/code><\/pre>\n\n\n\n
dnf install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-sql-scripts zabbix-selinux-policy zabbix-agent<\/code><\/pre>\n\n\n\n
\n============================================================================================================================================================================\n Package Architecture Version Repository Size\n============================================================================================================================================================================\nInstalling:\n zabbix-agent x86_64 6.0.4-1.el8 zabbix 528 k\n zabbix-apache-conf noarch 6.0.4-1.el8 zabbix 22 k\n zabbix-selinux-policy x86_64 6.0.4-1.el8 zabbix 280 k\n zabbix-server-mysql x86_64 6.0.4-1.el8 zabbix 1.6 M\n zabbix-sql-scripts noarch 6.0.4-1.el8 zabbix 6.5 M\n zabbix-web-mysql noarch 6.0.4-1.el8 zabbix 21 k\nInstalling dependencies:\n OpenIPMI-libs x86_64 2.0.31-3.el8 baseos 508 k\n apr x86_64 1.6.3-12.el8 appstream 128 k\n apr-util x86_64 1.6.1-6.el8.1 appstream 104 k\n fping x86_64 4.2-2.el8 epel 43 k\n httpd x86_64 2.4.37-43.module+el8.5.0+747+83fae388.3 appstream 1.4 M\n httpd-filesystem noarch 2.4.37-43.module+el8.5.0+747+83fae388.3 appstream 39 k\n httpd-tools x86_64 2.4.37-43.module+el8.5.0+747+83fae388.3 appstream 106 k\n mariadb-connector-c x86_64 3.1.11-2.el8_3 appstream 199 k\n mariadb-connector-c-config noarch 3.1.11-2.el8_3 appstream 14 k\n mod_http2 x86_64 1.15.7-3.module+el8.5.0+695+1fa8055e appstream 153 k\n nginx-filesystem noarch 1:1.14.1-9.module+el8.4.0+542+81547229 appstream 23 k\n php-bcmath x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 79 k\n php-common x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 701 k\n php-fpm x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 1.6 M\n php-gd x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 84 k\n php-json x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 73 k\n php-ldap x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 85 k\n php-mbstring x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 483 k\n php-mysqlnd x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 192 k\n php-pdo x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 122 k\n php-xml x86_64 7.4.19-1.module+el8.5.0+696+61e7c9ba appstream 173 k\n rocky-logos-httpd noarch 85.0-3.el8 baseos 22 k\n unixODBC x86_64 2.3.7-1.el8 appstream 453 k\n zabbix-web noarch 6.0.4-1.el8 zabbix 7.9 M\n zabbix-web-deps noarch 6.0.4-1.el8 zabbix 22 k\nInstalling weak dependencies:\n apr-util-bdb x86_64 1.6.1-6.el8.1 appstream 23 k\n apr-util-openssl x86_64 1.6.1-6.el8.1 appstream 26 k\n\nTransaction Summary\n============================================================================================================================================================================\nInstall 33 Packages\n\nTotal download size: 24 M\nInstalled size: 77 M\nIs this ok [y\/N]: y\n<\/code><\/pre>\n\n\n\n
Install MySQL and Create Zabbix Database and Database User<\/h3>\n\n\n\n
dnf install mysql-server<\/code><\/pre>\n\n\n\n
systemctl enable --now mysqld<\/code><\/pre>\n\n\n\n
mysql_secure_installation<\/code><\/pre>\n\n\n\n
mysql -u root -p<\/code><\/pre>\n\n\n\n
create database zabbixdb character set utf8 collate utf8_bin;<\/code><\/pre>\n\n\n\n
create user zabbixadmin@localhost identified by 'P@SSw0RD';<\/code><\/pre>\n\n\n\n
grant all on zabbixdb.* to zabbixadmin@localhost;<\/code><\/pre>\n\n\n\n
flush privileges;\nquit<\/code><\/pre>\n\n\n\n
Configuring Zabbix on Rocky Linux<\/h3>\n\n\n\n
\/etc\/zabbix\/zabbix_server.conf<\/code><\/strong>, and replace the values for DBName<\/strong>, DBUser<\/strong>, DBPassword<\/strong> with what you set while creating database. Uncomment the line
# DBHost=localhost<\/strong><\/code>.<\/p>\n\n\n\n
vim \/etc\/zabbix\/zabbix_server.conf<\/code><\/pre>\n\n\n\n
...\nDBHost=localhost<\/strong>\n...\nDBName=zabbixdb\n<\/strong>...\nDBUser=zabbixadmin\n<\/strong>...\nDBPassword=P@SSw0RD\n<\/strong>...\n<\/code><\/pre>\n\n\n\n
Import Zabbix Default Database and Initial Data<\/h3>\n\n\n\n
zcat \/usr\/share\/doc\/zabbix-sql-scripts\/mysql\/server.sql.gz | mysql -u zabbixadmin -p zabbixdb<\/code><\/pre>\n\n\n\n
Running Zabbix Server and Agent<\/h3>\n\n\n\n
systemctl restart zabbix-server zabbix-agent httpd php-fpm<\/code><\/pre>\n\n\n\n
firewall-cmd --add-port={10051,80,443}\/tcp --permanent\nfirewall-cmd --reload<\/code><\/pre>\n\n\n\n
Finalize Zabbix Setup on Web User Interface<\/h3>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/a><\/div>\n\n\n\n
<\/figure><\/div><\/a><\/div>\n\n\n\n
\n