{"id":1289,"date":"2019-04-12T15:50:36","date_gmt":"2019-04-12T12:50:36","guid":{"rendered":"https:\/\/helia.ee\/koolitus\/?page_id=1289"},"modified":"2019-10-27T00:10:43","modified_gmt":"2019-10-26T21:10:43","slug":"zabbix-zabbix-agent-install-and-conf","status":"publish","type":"page","link":"https:\/\/helia.ee\/koolitus\/?page_id=1289","title":{"rendered":"Zabbix &#8211; Zabbix Agent install and conf"},"content":{"rendered":"\r\n<h3 class=\"wp-block-heading\" id=\"debianubuntu\">2 Debian\/Ubuntu<\/h3>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"overview\">Overview<\/h4>\r\n\r\n\r\n\r\n<p>Official Zabbix packages are available for:<\/p>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>Debian 9 (Stretch)<\/li>\r\n<li>Debian 8 (Jessie)<\/li>\r\n<li>Debian 7 (Wheezy)<\/li>\r\n<li>Ubuntu 18.04 (Bionic Beaver) LTS<\/li>\r\n<li>Ubuntu 16.04 (Xenial Xerus) LTS<\/li>\r\n<li>Ubuntu 14.04 (Trusty Tahr) LTS<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"adding_zabbix_repository\">Adding Zabbix repository<\/h4>\r\n\r\n\r\n\r\n<p>Install the repository configuration package. This package contains apt (software package manager) configuration files.<\/p>\r\n\r\n\r\n\r\n<p>For\u00a0<strong>Debian 9<\/strong>, run the following commands:<\/p>\r\n\r\n\r\n\r\n<p><strong>Note!<\/strong> For Debian 8, substitute &#8216;stretch&#8217; with &#8216;jessie&#8217; in the commands. For Debian 7, substitute &#8216;stretch&#8217; with &#8216;wheezy&#8217; in the commands. <br \/><br \/>##########(All repo real tuleb \u00e4ra muuta stretch jessie`ks kui tahta vanemat versiooni kasutada debianist.)############<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># wget https:\/\/repo.zabbix.com\/zabbix\/3.4\/debian\/pool\/main\/z\/zabbix-release\/zabbix-release_3.4-1+stretch_all.deb\r\n# dpkg -i zabbix-release_3.4-1+stretch_all.deb\r\n# apt update<\/pre>\r\n\r\n\r\n\r\n<p>For\u00a0<strong>Ubuntu 18.04 (bionic)<\/strong>, run the following commands:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># wget https:\/\/repo.zabbix.com\/zabbix\/3.4\/ubuntu\/pool\/main\/z\/zabbix-release\/zabbix-release_3.4-1+bionic_all.deb\r\n# dpkg -i zabbix-release_3.4-1+bionic_all.deb\r\n# apt update<\/pre>\r\n\r\n\r\n\r\n<ul class=\"wp-block-list\">\r\n<li>For Ubuntu 16.04, substitute &#8216;bionic&#8217; with &#8216;xenial&#8217; in the commands.<\/li>\r\n<li>For Ubuntu 14.04, substitute &#8216;bionic&#8217; with &#8216;trusty&#8217; in the commands.<\/li>\r\n<\/ul>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"serverproxyfrontend_installation\">Server\/proxy\/frontend installation<\/h4>\r\n\r\n\r\n\r\n<p>To install Zabbix server with MySQL support:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># apt install zabbix-server-mysql<\/pre>\r\n\r\n\r\n\r\n<p>To install Zabbix proxy with MySQL support:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># apt install zabbix-proxy-mysql<\/pre>\r\n\r\n\r\n\r\n<p>To install Zabbix frontend:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># apt install zabbix-frontend-php<\/pre>\r\n\r\n\r\n\r\n<p>Substitute &#8216;mysql&#8217; in the commands with &#8216;pgsql&#8217; to use PostgreSQL, or with &#8216;sqlite3&#8217; to use SQLite3 (proxy only).<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"creating_database\">Creating database<\/h4>\r\n\r\n\r\n\r\n<p>For Zabbix\u00a0<a href=\"https:\/\/www.zabbix.com\/documentation\/3.4\/manual\/concepts\/server\">server<\/a>\u00a0and\u00a0<a href=\"https:\/\/www.zabbix.com\/documentation\/3.4\/manual\/concepts\/proxy\">proxy<\/a>\u00a0daemons a database is required. It is not needed to run Zabbix\u00a0<a href=\"https:\/\/www.zabbix.com\/documentation\/3.4\/manual\/concepts\/agent\">agent<\/a>.If Zabbix server and proxy are installed on the same host, their databases must be created with different names!<\/p>\r\n\r\n\r\n\r\n<p>Create the database using the provided instructions for\u00a0<a href=\"https:\/\/www.zabbix.com\/documentation\/3.4\/manual\/appendix\/install\/db_scripts#mysql\">MySQL<\/a>\u00a0or\u00a0<a href=\"https:\/\/www.zabbix.com\/documentation\/3.4\/manual\/appendix\/install\/db_scripts#postgresql\">PostgreSQL<\/a>.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"importing_data\">Importing data<\/h4>\r\n\r\n\r\n\r\n<p>Now import initial schema and data for the server with MySQL:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># zcat \/usr\/share\/doc\/zabbix-server-mysql\/create.sql.gz | mysql -uzabbix -p zabbix<\/pre>\r\n\r\n\r\n\r\n<p>You will be prompted to enter your newly created database password.<\/p>\r\n\r\n\r\n\r\n<p>With PostgreSQL:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># zcat \/usr\/share\/doc\/zabbix-server-pgsql\/create.sql.gz | sudo -u &lt;username&gt; psql zabbix<\/pre>\r\n\r\n\r\n\r\n<p>For proxy, import initial schema:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># zcat \/usr\/share\/doc\/zabbix-proxy-mysql\/schema.sql.gz | mysql -uzabbix -p zabbix<\/pre>\r\n\r\n\r\n\r\n<p>For proxy with PostgreSQL (or SQLite):<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># zcat \/usr\/share\/doc\/zabbix-proxy-pgsql\/schema.sql.gz | sudo -u &lt;username&gt; psql zabbix\r\n# zcat \/usr\/share\/doc\/zabbix-proxy-sqlite3\/schema.sql.gz | sqlite3 zabbix.db<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"configure_database_for_zabbix_serverproxy\">Configure database for Zabbix server\/proxy<\/h4>\r\n\r\n\r\n\r\n<p>Edit zabbix_server.conf or zabbix_proxy.conf to use the created database. For example:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># vi \/etc\/zabbix\/zabbix_server.conf\r\nDBHost=localhost\r\nDBName=zabbix\r\nDBUser=zabbix\r\nDBPassword=&lt;password&gt;<\/pre>\r\n\r\n\r\n\r\n<p>In DBPassword use Zabbix database password for MySQL; PosgreSQL user password for PosgreSQL.<\/p>\r\n\r\n\r\n\r\n<p>Use\u00a0<code>DBHost=<\/code>\u00a0with PostgreSQL. You might want to keep the default setting\u00a0<code>DBHost=localhost<\/code>\u00a0(or an IP address), but this would make PostgreSQL use a network socket for connecting to Zabbix. Refer to the\u00a0<a href=\"https:\/\/www.zabbix.com\/documentation\/3.4\/manual\/installation\/install_from_packages\/rhel_centos#selinux_configuration\">respective section<\/a>\u00a0for RHEL\/CentOS for instructions.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"starting_zabbix_server_process\">Starting Zabbix server process<\/h4>\r\n\r\n\r\n\r\n<p>It&#8217;s time to start Zabbix server process and make it start at system boot:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># service zabbix-server start\r\n# update-rc.d zabbix-server enable<\/pre>\r\n\r\n\r\n\r\n<p>Substitute &#8216;zabbix-server&#8217; with &#8216;zabbix-proxy&#8217; to start Zabbix proxy process.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"selinux_configuration\">SELinux configuration<\/h4>\r\n\r\n\r\n\r\n<p>Refer to the\u00a0<a href=\"https:\/\/www.zabbix.com\/documentation\/3.4\/manual\/installation\/install_from_packages\/rhel_centos#selinux_configuration\">respective section<\/a>\u00a0for RHEL\/CentOS.<\/p>\r\n\r\n\r\n\r\n<p>As frontend and SELinux configuration is done, you need to restart Apache web server:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># service apache2 restart<\/pre>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"frontend_configuration\">Frontend configuration<\/h4>\r\n\r\n\r\n\r\n<p>Apache configuration file for Zabbix frontend is located in \/etc\/apache2\/conf-enabled\/zabbix.conf. Some PHP settings are already configured. But it&#8217;s necessary to uncomment the \u201cdate.timezone\u201d setting and\u00a0<a href=\"http:\/\/php.net\/manual\/en\/timezones.php\">set the right timezone<\/a>\u00a0for you.<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\">php_value max_execution_time 300\r\nphp_value memory_limit 128M\r\nphp_value post_max_size 16M\r\nphp_value upload_max_filesize 2M\r\nphp_value max_input_time 300\r\nphp_value max_input_vars 10000\r\nphp_value always_populate_raw_post_data -1\r\n# php_value date.timezone Europe\/Riga<\/pre>\r\n\r\n\r\n\r\n<p>Now you are ready to proceed with\u00a0<a href=\"https:\/\/www.zabbix.com\/documentation\/3.4\/manual\/installation\/install#installing_frontend\">frontend installation steps<\/a>\u00a0which will allow you to access your newly installed Zabbix.<\/p>\r\n\r\n\r\n\r\n<h4 class=\"wp-block-heading\" id=\"agent_installation\">Agent installation<\/h4>\r\n\r\n\r\n\r\n<p>To install the agent, run<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># apt install zabbix-agent<\/pre>\r\n\r\n\r\n\r\n<p>To start the agent, run:<\/p>\r\n\r\n\r\n\r\n<pre class=\"wp-block-preformatted\"># service zabbix-agent start<\/pre>\r\n","protected":false},"excerpt":{"rendered":"<p>2 Debian\/Ubuntu Overview Official Zabbix packages are available for: Debian 9 (Stretch) Debian 8 (Jessie) Debian 7 (Wheezy) Ubuntu 18.04 (Bionic Beaver) LTS Ubuntu 16.04 (Xenial Xerus) LTS Ubuntu 14.04 (Trusty Tahr) LTS Adding Zabbix repository Install the repository configuration package. This package contains apt (software package manager) configuration files. For\u00a0Debian 9, run the following [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":1475,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":""},"class_list":["post-1289","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1289"}],"version-history":[{"count":2,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1289\/revisions"}],"predecessor-version":[{"id":1480,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1289\/revisions\/1480"}],"up":[{"embeddable":true,"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=\/wp\/v2\/pages\/1475"}],"wp:attachment":[{"href":"https:\/\/helia.ee\/koolitus\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}