{"id":567,"date":"2017-06-06T21:31:58","date_gmt":"2017-06-06T19:31:58","guid":{"rendered":"http:\/\/itsimple.info\/?p=567"},"modified":"2020-05-21T12:24:16","modified_gmt":"2020-05-21T10:24:16","slug":"how-to-install-zabbix-on-centos-7","status":"publish","type":"post","link":"https:\/\/itsimple.info\/?p=567","title":{"rendered":"How to install zabbix on centOS 7"},"content":{"rendered":"<h3><\/h3>\n<h3>Zabbix is one of the best open source monitoring system out there with flexibly and ready templates it is easy to install and get started fast. Here is step by step installation guide to run it on Linux CentOS 7.X<\/h3>\n<p>install repository: (make sure the path to the latest version by surfing to http:\/\/repo.zabbix.com\/zabbix\/4.0\/rhel\/7\/x86_64\/ )<\/p>\n<pre><code class=\"code-snippet\">rpm -i http:\/\/repo.zabbix.com\/zabbix\/4.0\/rhel\/7\/x86_64\/zabbix-release-4.0-1.el7.noarch.rpm <\/code><\/pre>\n<p>On CentOS you might get error on missing libssh2, you can install it from here:<\/p>\n<pre>dnf -y install https:\/\/rpmfind.net\/linux\/centos\/7.8.2003\/os\/x86_64\/Packages\/libssh2-1.8.0-3.el7.x86_64.rpm<\/pre>\n<p>install zabbix using MYSQL (Mariadb) as database, recommended for large scale systems:<\/p>\n<pre>yum -y install zabbix-server-mysql zabbix-web-mysql mysql mariadb-server httpd php zabbix-get zabbix-sender<\/pre>\n<p>make run and start automatic when booting<\/p>\n<pre>systemctl start mariadb\nsystemctl enable mariadb\n\n<\/pre>\n<p>Lats start MariaDB installation, enter the password for SQL administrator (none if you run it for the first time,Then choose password) :<\/p>\n<pre>mysql_secure_installation\nmysql -u root -p<\/pre>\n<p>We will create Database called: zabbix_db<\/p>\n<pre>create database zabbix_db;<\/pre>\n<p>Lets create user for the Database=zabbix_user and the password=zabbix<\/p>\n<pre>grant all privileges on zabbix_db.* to zabbix_user@localhost identified by 'zabbix' ;\nflush privileges;\nexit\n\n<\/pre>\n<p>Then import initial schema and data. Make sure to insert correct version for 3.4.X. You will be prompted to enter your newly created password.the script are here:<\/p>\n<p>\/usr\/share\/doc\/zabbix-server-mysql<\/p>\n<pre>zcat \/usr\/share\/doc\/zabbix-server-mysql-4.0.0\/create.sql.gz | mysql -u zabbix_user -p zabbix_db<\/pre>\n<p>Enter the password that you use to create the database, make sure you have zabbix_user@localhost and that he have full permission to the database, IF not just create the user with <a href=\"https:\/\/itsimple.info\/?p=69\" target=\"_blank\" rel=\"noopener noreferrer\">WEBMIN<\/a> on mysql .<\/p>\n<p>another option is to just extract the db schema and create in steps :<\/p>\n<pre>cd \/usr\/share\/doc\/zabbix-server-mysql-4.0.0<\/pre>\n<pre>gunzip create.sql.gz \nmysql -u zabbix_user -p zabbix_db &lt; create.sql   (you can create the db with webmin and then execute the script)<\/pre>\n<p>Now lets edit the Zabbix config files :<\/p>\n<pre>nano \/etc\/zabbix\/zabbix_server.conf\n\nDBHost=localhost\nDBName=zabbix_db\nDBUser=zabbix_user\nDBPassword=XXXXXXX<\/pre>\n<p>Edit the PHP file to support the zabbix on apache :<\/p>\n<pre>nano \/etc\/httpd\/conf.d\/zabbix.conf\n\nphp_value max_execution_time 300\nphp_value memory_limit 256M\nphp_value post_max_size 32M\nphp_value upload_max_filesize 32M\nphp_value max_input_time 600\nphp_value always_populate_raw_post_data -1\nphp_value date.timezone\u00a0 Asia\/Jerusalem<\/pre>\n<p>Make the zabbix run and start automatic (if it do not run disable the <a href=\"https:\/\/www.centos.org\/docs\/5\/html\/5.1\/Deployment_Guide\/sec-sel-enable-disable.html\">SElinux<\/a>):<\/p>\n<pre>systemctl start zabbix-server\nsystemctl enable zabbix-server\nsystemctl start httpd\nsystemctl enable httpd\n\n<\/pre>\n<p>Open the firewall ports for the system to communicate :<\/p>\n<pre>firewall-cmd --permanent --add-port=10050\/tcp\nfirewall-cmd --permanent --add-port=10051\/tcp\nfirewall-cmd --permanent --add-port=80\/tcp\nfirewall-cmd --reload\u00a0\nsystemctl restart firewalld<\/pre>\n<p>Check the firewall status :<\/p>\n<pre>firewall-cmd --zone=public --permanent --list-ports<\/pre>\n<p>Allow Zabbix with SElinux<\/p>\n<pre>setsebool -P httpd_can_connect_zabbix=1<\/pre>\n<p>Now open browser and surf to :<\/p>\n<pre>http:\/\/your-zabbix-server-IP\/zabbix<\/pre>\n<p>The default Zabbix admin username :<\/p>\n<pre>user= Admin\u00a0 pass=zabbix<\/pre>\n<p>Follow the first time wizard to complete the installation<\/p>\n<hr \/>\n<p>Tamplates can be downloaded from <a href=\"https:\/\/share.zabbix.com\/\">https:\/\/share.zabbix.com\/<\/a><\/p>\n<p>Presentation of Zabbix : <a href=\"http:\/\/www.zabbix.com\/presentation\">http:\/\/www.zabbix.com\/presentation<\/a><\/p>\n<p>All downloads including ready Zabbix on ubuntu system ISO : <a href=\"http:\/\/www.zabbix.com\/download\">http:\/\/www.zabbix.com\/download<\/a><\/p>\n<h2>Good Luck<\/h2>\n","protected":false},"excerpt":{"rendered":"<p>Zabbix is one of the best open source monitoring system out there with flexibly and ready templates it is easy to install and get started fast. Here is step by step installation guide to run it on Linux CentOS 7.X install repository: (make sure the path to the latest version by surfing to http:\/\/repo.zabbix.com\/zabbix\/4.0\/rhel\/7\/x86_64\/ ) [&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,12],"tags":[],"class_list":["post-567","post","type-post","status-publish","format-standard","hentry","category-centos","category-linux","category-tutorials"],"_links":{"self":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/567","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=567"}],"version-history":[{"count":0,"href":"https:\/\/itsimple.info\/index.php?rest_route=\/wp\/v2\/posts\/567\/revisions"}],"wp:attachment":[{"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=567"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=567"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/itsimple.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=567"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}