{"id":4206,"date":"2018-03-07T20:09:52","date_gmt":"2018-03-07T20:09:52","guid":{"rendered":"https:\/\/geekdecoder.com\/?p=4206"},"modified":"2018-03-07T20:09:52","modified_gmt":"2018-03-07T20:09:52","slug":"install-zabbix-server-3-4-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.qbytes.cloud\/index.php\/2018\/03\/07\/install-zabbix-server-3-4-on-centos-7\/","title":{"rendered":"Install Zabbix Server 3.4 on CentOS 7"},"content":{"rendered":"<p>In this KB, we will install the Zabbix Monitoring Server on CentOS 7.<br \/>\n<!--more--><\/p>\n<p>Install the basics. Add this as install.sh on the server:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># yum install nano -y<\/pre>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># nano install.sh<\/pre>\n<p>Add the following to the file:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n#!\/bin\/bash\nyum update -y\nyum install -y epel-release\nyum -y groupinstall &#039;Development Tools&#039;\nyum -y install yum-utils\nyum install httpd -y\nsystemctl enable httpd.service\nsystemctl start httpd.service\nyum install mariadb-server mariadb -y\nsystemctl enable mariadb\nsystemctl start mariadb\nsudo mysql_secure_installation\nyum -y install httpd mod_ssl php php-zip php-fpm php-devel php-gd php-imap php-ldap php-mysql php-odbc php-pear php-xml php-xmlrpc php-pecl-apc php-mbstring php-mcrypt php-soap php-tidy curl curl-devel perl-libwww-perl ImageMagick libxml2 libxml2-devel mod_fcgid php-cli httpd-devel php-fpm php-intl php-imagick php-pspell wget\nyum install php php-pear -y\nsystemctl restart httpd.service\nyum install firewalld -y\nsystemctl enable firewalld\nsystemctl start firewalld\nsudo firewall-cmd --permanent --zone=public --add-service=http\nsudo firewall-cmd --permanent --zone=public --add-service=https\nsudo firewall-cmd --reload\n<\/pre>\n<p>Make executable:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># chmod +x install.sh\n<\/pre>\n<p>Run the script:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># .\/install.sh\n<\/pre>\n<p>Installl Zabbix:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># rpm --import http:\/\/repo.zabbix.com\/RPM-GPG-KEY-ZABBIX\n# rpm -ivh http:\/\/repo.zabbix.com\/zabbix\/3.4\/rhel\/7\/x86_64\/zabbix-release-3.4-1.el7.centos.noarch.rpm\n# yum install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get zabbix-sender zabbix-java-gateway -y\n<\/pre>\n<p>Create the database:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># mysql -u root -p\nEnter password:\nWelcome to the MariaDB monitor.  Commands end with ; or \\g.\nYour MariaDB connection id is 11\nServer version: 5.5.56-MariaDB MariaDB Server\nCopyright (c) 2000, 2017, Oracle, MariaDB Corporation Ab and others.\nType &#039;help;&#039; or &#039;\\h&#039; for help. Type &#039;\\c&#039; to clear the current input statement.\nMariaDB &#x5B;(none)]&amp;gt; CREATE DATABASE zabbixdb CHARACTER SET utf8 COLLATE utf8_bin;\nQuery OK, 1 row affected (0.00 sec)\nMariaDB &#x5B;(none)]&amp;gt; GRANT ALL PRIVILEGES ON zabbixdb.* TO zabbixuser@localhost IDENTIFIED BY &quot;password&quot;;\nQuery OK, 0 rows affected (0.00 sec)\nMariaDB &#x5B;(none)]&amp;gt; FLUSH PRIVILEGES;\nQuery OK, 0 rows affected (0.00 sec)\nMariaDB &#x5B;(none)]&amp;gt; quit\n<\/pre>\n<p>Import initial database:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># zcat \/usr\/share\/doc\/zabbix-server-mysql-3.4.7\/create.sql.gz | mysql -uroot -p zabbixdb\n<\/pre>\n<p>edit database configuration in the zabbix server configuration file zabbix_server.conf<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># nano \/etc\/zabbix\/zabbix_server.conf\n<\/pre>\n<p>Specify the database name for zabbix , database user name and the password<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">DBHost=localhost\nDBName=zabbixdb\nDBUser=zabbixuser\nDBPassword=Password\n\n<\/pre>\n<p>Set SELinux settings and adjust Firewall<br \/>\nHaving SELinux status enabled in enforcing mode, you need to execute the following command to enable successful connection of Zabbix frontend to the server<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># setsebool -P httpd_can_network_connect=1\n# setsebool -P httpd_can_connect_zabbix=1\n# setsebool -P zabbix_can_network=1\n\n<\/pre>\n<p>Restart Apache:<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># systemctl start httpd\n<\/pre>\n<p>Start\/Enable Zabbix<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\"># systemctl enable zabbix-server \n# systemctl start zabbix-server\n# systemctl enable zabbix-agent \n# systemctl start zabbix-agent\n<\/pre>\n<p>Configure Zabbix<br \/>\nNavigate to http:\/\/ip_address\/zabbix or http:\/\/host_name\/zabbix<br \/>\n<a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4216\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab1.png\" alt=\"\" width=\"845\" height=\"506\" \/><\/a><\/p>\n<p>Make sure that all software prerequisites are met.<\/p>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4217\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab2.png\" alt=\"\" width=\"823\" height=\"498\" \/><\/a><\/p>\n<p>Enter details for connecting to the database. Zabbix database must already be created.<\/p>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4218\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab3.png\" alt=\"\" width=\"850\" height=\"503\" \/><\/a><\/p>\n<p>Enter Zabbix server details.<\/p>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4219\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab4.png\" alt=\"\" width=\"843\" height=\"498\" \/><\/a><\/p>\n<p>Review a summary of settings.<\/p>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4220\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab5.png\" alt=\"\" width=\"852\" height=\"505\" \/><\/a><\/p>\n<p>Finish the installation.<\/p>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4221\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab6.png\" alt=\"\" width=\"850\" height=\"503\" \/><\/a><\/p>\n<p>Login:<\/p>\n<p>The default user name is\u00a0<strong>Admin<\/strong>\u00a0and the password is\u00a0<strong>zabbix<\/strong>\u00a0.<\/p>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab7.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4222\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab7.png\" alt=\"\" width=\"373\" height=\"447\" \/><\/a><\/p>\n<p>Last thing to do is to enable your server zabbix to be monitored: go to Configuration -&gt; Hosts. Select the host (zabbix server) and click \u201cDisabled\u201d<\/p>\n<p><a href=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4223\" src=\"https:\/\/qbytes.cloud\/wp-content\/uploads\/2018\/03\/zab8.png\" alt=\"\" width=\"1012\" height=\"133\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this KB, we will install the Zabbix Monitoring Server on CentOS 7.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[133],"tags":[],"class_list":["post-4206","post","type-post","status-publish","format-standard","hentry","category-zabbix"],"_links":{"self":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4206","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/comments?post=4206"}],"version-history":[{"count":0,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/posts\/4206\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/media?parent=4206"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/categories?post=4206"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.qbytes.cloud\/index.php\/wp-json\/wp\/v2\/tags?post=4206"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}