{"id":3787,"date":"2019-07-26T22:49:16","date_gmt":"2019-07-26T19:49:16","guid":{"rendered":"https:\/\/kifarunix.com\/?p=3787"},"modified":"2024-03-12T07:31:46","modified_gmt":"2024-03-12T04:31:46","slug":"install-zabbix-server-on-debian-10-buster","status":"publish","type":"post","link":"https:\/\/kifarunix.com\/install-zabbix-server-on-debian-10-buster\/","title":{"rendered":"Install Zabbix Server on Debian 10 Buster"},"content":{"rendered":"\n

In this guide, we are going to learn how to install Zabbix server on Debian 10 Buster. Zabbix<\/a> is an enterprise class monitoring solution for any kind of IT infrastructure, services, applications, cloud resources.<\/p>\n\n\n\n

Installing Zabbix Server on Debian 10 Buster<\/h2>\n\n\n\n

Zabbix can be built from the source code or can be installed from Zabbix repository. In this guide, we are going to use Zabbix repository.<\/p>\n\n\n\n

Install Zabbix APT repository <\/h3>\n\n\n\n

Debian 10 Buster do not include Zabbix repository by default. Hence, you can install it by running the command below. Note that Zabbix 4.2<\/a> is the current stable release as of this writing. <\/p>\n\n\n\n

wget https:\/\/repo.zabbix.com\/zabbix\/4.2\/debian\/pool\/main\/z\/zabbix-release\/zabbix-release_4.2-1+buster_all.deb\napt install .\/zabbix-release_4.2-1+buster_all.deb<\/code><\/pre>\n\n\n\n

Next, run system update.<\/p>\n\n\n\n

apt update -y\napt upgrade -y<\/code><\/pre>\n\n\n\n

Install Zabbix Server, Frontend and Agent<\/h3>\n\n\n\n

Zabbix uses the LAMP stack components, Apache, MariaDB and PHP. To install these components, run the command below;<\/p>\n\n\n\n

apt install zabbix-server-mysql zabbix-frontend-php<\/code><\/pre>\n\n\n\n

The above command installs Apache 2.43, Mariadb 10.3 and PHP 7.3<\/p>\n\n\n\n

apache2 -v\nServer version: Apache\/2.4.38 (Debian)\nServer built:   2019-04-07T18:15:40<\/code><\/pre>\n\n\n\n
php -v\nPHP 7.3.4-2 (cli) (built: Apr 13 2019 19:05:48) ( NTS )\nCopyright (c) 1997-2018 The PHP Group\nZend Engine v3.3.4, Copyright (c) 1998-2018 Zend Technologies\n    with Zend OPcache v7.3.4-2, Copyright (c) 1999-2018, by Zend Technologies<\/code><\/pre>\n\n\n\n
mariadb -V\nmariadb  Ver 15.1 Distrib 10.3.15-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2<\/code><\/pre>\n\n\n\n

Also, if you need to monitor the Zabbix server itself, you need to install Zabbix agent.<\/p>\n\n\n\n

apt install zabbix-agent<\/code><\/pre>\n\n\n\n

Create Zabbix MariaDB Database and User<\/h3>\n\n\n\n

Once the installation of the Zabbix components completes, begin by creating a MariaDB database for Zabbix and a Zabbix user.<\/p>\n\n\n\n

However, run mysql_secure_installation<\/strong> MariaDB initial security script to remove anonymous users, test databases and to disable remote root login.<\/p>\n\n\n\n

Note that by default, MariaDB 10.3 uses unix socket for authentication and hence, you can login without password set (Even if you set password with mysql_secure_installation<\/strong>). Therefore, you can login by just typing mysql<\/strong> or mysql -u root<\/strong>.<\/p>\n\n\n\n

mysql -u root<\/code><\/pre>\n\n\n\n

Create Zabbix database.<\/p>\n\n\n\n

create database zabbixdb;<\/code><\/pre>\n\n\n\n

Create the Zabbix database user and grant all the privileges on Zabbix database.<\/p>\n\n\n\n

grant all on zabbixdb.* to zabbixadmin@localhost identified by 'Str0NGPass';<\/code><\/pre>\n\n\n\n

Reload the privilege tables to ensure that all changes made take effect immediately and exit the database.<\/p>\n\n\n\n

flush privileges;\nquit<\/code><\/pre>\n\n\n\n

If you need enable root user password authentication, login to database and run the command below;<\/p>\n\n\n\n

mysql -u root\nSET old_passwords=0;\nALTER USER root@localhost IDENTIFIED BY 'StronGP@SS';\nflush privileges;\nquit<\/code><\/pre>\n\n\n\n

Next, import initial Zabbix database schema and data to the newly create database.<\/p>\n\n\n\n

zcat \/usr\/share\/doc\/zabbix-server-mysql\/create.sql.gz | mysql -u zabbixadmin -p zabbixdb<\/code><\/pre>\n\n\n\n

Next, open the Zabbix configuration file and set the value of DBName<\/strong>, DBUser<\/strong>, DBPassword<\/strong> to reflect your settings. Also, configure local database connection.<\/p>\n\n\n\n

...\nDBHost=localhost\n...\nDBName=zabbixdb\n...\nDBUser=zabbixadmin\n...\nDBPassword=Str0NGPass<\/code><\/pre>\n\n\n\n

Configure PHP for Zabbix frontend<\/h3>\n\n\n\n

Zabbix frontend is written in PHP. On of the configuration that is required is to set the PHP timezone. Hence, edit the file, and set the timezone for PHP 7.<\/p>\n\n\n\n

vim \/etc\/zabbix\/apache.conf<\/code><\/pre>\n\n\n\n
\n...\n    <IfModule mod_php7.c>\n        php_value max_execution_time 300\n        php_value memory_limit 128M\n        php_value post_max_size 16M\n        php_value upload_max_filesize 2M\n        php_value max_input_time 300\n        php_value max_input_vars 10000\n        php_value always_populate_raw_post_data -1\n        # php_value date.timezone Europe\/Riga\n        php_value date.timezone Africa\/Nairobi\n    <\/IfModule>\n<\/code><\/pre>\n\n\n\n

Restart Apache Web server.<\/p>\n\n\n\n

systemctl restart apache2<\/code><\/pre>\n\n\n\n

The Zabbix frontend configuration will be finalized from the web UI.<\/p>\n\n\n\n

Running Zabbix server and Agent<\/h3>\n\n\n\n

Once you are done with the configuration, restart the Zabbix server and agent and enable them to run on system boot.<\/p>\n\n\n\n

systemctl restart zabbix-server zabbix-agent\nsystemctl enable zabbix-server zabbix-agent<\/code><\/pre>\n\n\n\n

Configure Zabbix Web User Interface<\/h3>\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>. When access the address above, the first page you land on is Zabbix welcome page.<\/p>\n\n\n

\n
\"Install<\/a><\/figure><\/div>\n\n\n

Click Next Step to verify if all the Zabbix requirements have been met.<\/p>\n\n\n

\n
\"\"<\/a><\/figure><\/div>\n\n\n

Configure Zabbix database connection using the connection details set above.<\/p>\n\n\n

\n
\"Debian<\/a><\/figure><\/div>\n\n\n

Setup the Zabbix server details. You can leave the default settings.<\/p>\n\n\n

\n
\"set<\/a><\/figure><\/div>\n\n\n

On the Pre-installation summary, verify if all the configurations are fine.<\/p>\n\n\n

\n
\"Zabbix<\/a><\/figure><\/div>\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
\"\"<\/figure><\/div>\n\n\n

You have successfully setup Zabbix Frontend. Click Finish<\/strong> to get to Zabbix login interface.<\/p>\n\n\n

\n
\"Zabbix<\/a><\/figure><\/div>\n\n\n

The default login credentials are admin<\/strong> as the username and zabbix<\/strong> as the password. When you successfully login to Zabbix, you should land on the default dashboard.<\/p>\n\n\n

\n
\"Zabbix<\/a><\/figure><\/div>\n\n\n

Well, there you go. You have successfully installed Zabbix server on Debian 10 Buster. In our next guide, we will how to monitor remote hosts using Zabbix server.<\/p>\n\n\n\n

Related Tutorials<\/h3>\n\n\n\n

How to Install and Configure Zabbix 4.0 from Source on Fedora 29\/Fedora 28\/CentOS 7<\/a><\/p>\n\n\n\n

Install Nagios Core on Debian 10 Buster<\/a><\/p>\n\n\n\n

Install and Configure SNMP on Debian 10 Buster<\/a><\/p>\n\n\n\n

How to install and configure AlienVault OSSIM 5.5 on VirtualBox<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"

In this guide, we are going to learn how to install Zabbix server on Debian 10 Buster. Zabbix is an enterprise class monitoring solution for<\/p>\n","protected":false},"author":1,"featured_media":12691,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"rank_math_lock_modified_date":false,"footnotes":""},"categories":[121,72,261],"tags":[1039,5135,1054,1052,1053],"class_list":["post-3787","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-howtos","category-monitoring","category-zabbix","tag-debian-10-buster","tag-install-zabbix-server-on-debian-10-buster","tag-latest-zabbix","tag-zabbix","tag-zabbix-4-2","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50","resize-featured-image"],"_links":{"self":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3787"}],"collection":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/comments?post=3787"}],"version-history":[{"count":8,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3787\/revisions"}],"predecessor-version":[{"id":21168,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/posts\/3787\/revisions\/21168"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media\/12691"}],"wp:attachment":[{"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/media?parent=3787"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/categories?post=3787"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kifarunix.com\/wp-json\/wp\/v2\/tags?post=3787"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}