{"id":1448,"date":"2020-07-01T00:28:33","date_gmt":"2020-06-30T22:28:33","guid":{"rendered":"https:\/\/itsimple.info\/?p=1448"},"modified":"2021-10-20T16:24:21","modified_gmt":"2021-10-20T14:24:21","slug":"how-to-install-zabbix-5-on-centos-8","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=1448","title":{"rendered":"How To Install Zabbix 5 On CentOS 8"},"content":{"rendered":"<p>Zabbix 5 has a lot of GUI imrovment and other new features, notice the installation on CentOS 8 is a little different. lets start .<\/p>\n<p>If you are a fan of SELinux you can set it to permissive mode :<\/p>\n<pre class=\"wp-block-preformatted\">setenforce 0 &amp;&amp; sed -i 's\/^SELINUX=.*\/SELINUX=permissive\/g' \/etc\/selinux\/config<br \/><br \/>To disable just edit with #nano \/etc\/selinux\/config <br \/><br \/>And set :  <code>SELINUX=disabled<\/code><\/pre>\n<p>Next install libssh2.so.1 which is needed by zabbix 5<\/p>\n<p>To use libssh2 you must enable the EPEL repo. After that libssh2 can be installed<\/p>\n<pre>yum install epel-release\n\nyum install libssh2<\/pre>\n<p>In case of develop environment you can install the libssh2-devel<\/p>\n<pre>yum install libssh2-devel<\/pre>\n<p>Then install zabbix<\/p>\n<pre><span style=\"color: #0000ff;\">rpm -Uvh https:\/\/repo.zabbix.com\/zabbix\/5.4\/rhel\/8\/x86_64\/zabbix-release-5.4-1.el8.noarch.rpm<\/span><br \/><span style=\"color: #0000ff;\">dnf clean all<\/span><br \/><span style=\"color: #0000ff;\">dnf -y install zabbix-server-mysql zabbix-web-mysql zabbix-apache-conf zabbix-agent zabbix-sql-scripts<\/span><\/pre>\n<p>Now we have to add mysql server = mariaDB<\/p>\n<pre><span style=\"color: #0000ff;\">dnf -y install mariadb-server &amp;&amp; systemctl start mariadb &amp;&amp; systemctl enable mariadb<\/span><\/pre>\n<p>configure the mysql server :<\/p>\n<p>If your environment is going to monitor a lot of host , I recommend using MySQL database with file for each table, this option is going to help in reducing the database size in the future as the table can be controlled and all the data is spread. in the default setting the data is in one file ibdata1 which can be very big. So edit the file \/etc\/my.cnf :<\/p>\n<pre>[mysqld]<br \/>innodb_file_per_table<\/pre>\n<pre><span style=\"color: #0000ff;\"><br \/><br \/><span style=\"color: #000000;\">So Lets continue :<\/span><br \/><br \/><br \/>mysql_secure_installation<\/span><\/pre>\n<p>Create User &amp; DB (notice the charset = utf8 which is required by zabbix 5)<\/p>\n<pre><span style=\"color: #0000ff;\">mysql -u root -p<\/span><br \/><span style=\"color: #0000ff;\">create database zabbix_db character set utf8 collate utf8_bin;<\/span><br \/><span style=\"color: #0000ff;\">grant all privileges on zabbix_db.* to zabbix_user@localhost identified by 'zabbix' ;<\/span><br \/><span style=\"color: #0000ff;\">flush privileges;<\/span><br \/><span style=\"color: #0000ff;\">show create database zabbix_db;<\/span>\u00a0\u00a0\u00a0\u00a0 <span style=\"color: #ff0000;\">-&gt;to make sure db is created O.K<\/span><br \/><span style=\"color: #0000ff;\">exit<\/span><\/pre>\n<pre>Temporary disable strict mode (ZBX-16465) to avoid MySQL error \u201cERROR 1118 (42000) at line 1284: Row size too large (&gt; 8126)\u201d :<br \/><span style=\"color: #0000ff;\">#mysql -uroot -p'your_password you set for mysql' zabbix_db -e \"set global innodb_strict_mode='OFF';\"<\/span><\/pre>\n<pre>build database :<br \/><span style=\"color: #0000ff;\">#zcat \/usr\/share\/doc\/zabbix-sql-scripts\/mysql\/create.sql.gz | mysql zabbix_db -uzabbix_user -pzabbix<br \/><br \/><\/span>re-enable stric mode:<br \/><span style=\"color: #0000ff;\">#mysql -uroot -p'your_password you set for mysql' zabbix_db -e \"set global innodb_strict_mode='ON';\"<\/span><\/pre>\n<p>configure Zabbix for the database we have prepared for it :<\/p>\n<pre><span style=\"color: #0000ff;\">#nano \/etc\/zabbix\/zabbix_server.conf<\/span><br \/><span style=\"color: #800080;\">DBname=zabbix_db<\/span><br \/><span style=\"color: #800080;\">DBuser=zabbix_user<\/span><br \/><span style=\"color: #800080;\">DBPassword=zabbix<\/span><\/pre>\n<p>Start zabbix<\/p>\n<pre><span style=\"color: #0000ff;\">#systemctl restart zabbix-server zabbix-agent <\/span><br \/><span style=\"color: #0000ff;\">#systemctl enable zabbix-server zabbix-agent<\/span><\/pre>\n<p>Add firewall rules<\/p>\n<pre><span style=\"color: #0000ff;\">#firewall-cmd --add-service={http,https} --permanent<\/span><br \/><span style=\"color: #0000ff;\">#firewall-cmd --add-port={10051\/tcp,10050\/tcp} --permanent<\/span><br \/><span style=\"color: #0000ff;\">#firewall-cmd --reload<\/span><\/pre>\n<p>Now lets start configure the web frontend<\/p>\n<pre><span style=\"color: #0000ff;\">#nano \/etc\/php-fpm.d\/zabbix.conf<\/span><br \/><span style=\"color: #800080;\">php_value date.timezone Asia\/Jerusalem<\/span><\/pre>\n<p>restart the website service :<\/p>\n<pre><span style=\"color: #0000ff;\">#systemctl restart httpd php-fpm<\/span><br \/><span style=\"color: #0000ff;\">#systemctl enable httpd php-fpm<\/span><\/pre>\n<p>Thats it ! Now open a browser and surf to<\/p>\n<pre><span style=\"color: #0000ff;\">http:\/\/your_zabbix_server_IP\/zabbix<\/span><\/pre>\n<pre>Enter this variables <br \/><span style=\"color: #800080;\">Database name : zabbix_db<\/span><br \/><span style=\"color: #800080;\">user : zabbix_user<\/span><br \/><span style=\"color: #800080;\">Password : zabbix<\/span><\/pre>\n<h4>default user name : Admin\u00a0\u00a0 Password: zabbix<\/h4>\n<h4>Now you are done! enjoy<\/h4>\n<hr \/>\n<h3>Good Luck<\/h3>\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Zabbix 5 has a lot of GUI imrovment and other new features, notice the installation on CentOS 8 is a little different. lets start . If you are a fan of SELinux you can set it to permissive mode : setenforce 0 &amp;&amp; sed -i &#8216;s\/^SELINUX=.*\/SELINUX=permissive\/g&#8217; \/etc\/selinux\/configTo disable just edit with #nano \/etc\/selinux\/config And set [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[16,13,21,12],"tags":[],"class_list":["post-1448","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-operating-systems","category-tutorials"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/1448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1448"}],"version-history":[{"count":0,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/1448\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}